Form fields

Form fields are form elements designed for data input and/or data display.

Purpose of form fields

A form field is a form item dedicated to data management. It associates a form item with a screen record field. The screen record field is used to bind program variables in interaction instructions (for example, dialogs). The program variables are the data models for the form fields.

There are different types of form fields:

Form fields are identified by the field name in programs, and are grouped in screen records (or screen arrays in the case of list containers). The interactive instruction must mediate between screen record fields and database columns by using program variables.

Form fields are usually related to database column, which types are defined in the database schema file.

Position and size of a form field

The position and size of a form field is defined with an item tag in the form layout, while the rendering and behavior is defined in the ATTRIBUTES section. Both parts are bound by the name of the item tag. The item tag name is local to the .per file and is not available at runtime: It is just the key to bind the item tag (position) with the item definition (attributes).

In the next example, the "f1" item tag (in the LAYOUT section) is linked to the "vehicle.num" form field definition (in the ATTRIBUTES section), which references a column of the "vehicle" table, defined in the "carstore" database schema:

SCHEMA carstore 
LAYOUT
GRID
{
Number:   [f1            ]
Name:     [f2                        ]
}
END
END
TABLES
  vehicle 
END
ATTRIBUTES
  EDIT f1 = vehicle.num, STYLE="keycol";
  EDIT f2 = vehicle.name, UPSHIFT;
END

See also Grid-based layout.