Form items

A form item defines a form element such as a form field or a layout item.

The concept of form item includes all elements that can be defined in a form specification file.

For example, a form item can be an input field such as an EDIT field, a push BUTTON, or a layout element, such as a GROUPBOX.

The position and length of a form item in the layout is defined by a place holder called 'tag' (item tag, hbox tag or layout tag). Such place holders are used in the body of GRID, SCROLLGRID and TABLE containers.

The appearance and the behavior of a form item is defined in the ATTRIBUTES section.

Form items defined for data management are called form fields.

Form items can be identified with a unique name. Form fields have to be identified with the tabname.colname specification after the equal sign, while other (non-field) form items such as static labels and groupboxes can get an optional item name , and identifier to be specified after the colon sign. The tabname.colname or the item name will be copied to the name attribute of the corresponding node in the .42f file. This identifier can then be used in programs to find a specific form element in the form. For example, to hide a group box with the identifier group1, you can use the ui.Form.setElementHidden("group1",1) method on the form object.

SCHEMA carstore 
LAYOUT( TEXT = "Vehicles" )
  GRID
  {
   <G g1                                  >
    Number:   [f1            ]
    Name:     [f2                        ]
              [b1              ]

  }
  END
END
TABLES
  vehicle 
END
ATTRIBUTES
  GROUP g1: group1, TEXT="Identification" ;
  EDIT f1 = vehicle.num;
  EDIT f2 = vehicle.name;
  BUTTON b1: validate, TEXT="Ok";
END