Defining field tabbing order method

Syntax

OPTIONS FIELD ORDER { CONSTRAINED | UNCONSTRAINED | FORM }

Usage

Tabbing order is used in interactive instructions such as INPUT, INPUT ARRAY, or CONSTRUCT, where individual fields can get the focus.

The FIELD ORDER runtime option defines the default behavior when moving from field to field with the TAB and SHIFT-TAB keys in GUI mode, and with the Up / Down arrow keys in TUI mode.

The OPTIONS FIELD ORDER defines the global field order mode. The field order mode can also be defined at the dialog level, with the FIELD ORDER dialog attribute.

By default, the tabbing order is defined by the list of fields used by the program instruction. This corresponds to FIELD ORDER CONSTRAINED option, which is the default.

When using FIELD ORDER UNCONSTRAINED in TUI mode, the Up and Down arrow keys will move the cursor to the field above or below the current field, respectively. When using the default FIELD ORDER CONSTRAINED option, the Up and Down arrow keys move the cursor to the previous or next field, respectively. If FIELD ORDER UNCONSTRAINED is used, the Dialog.fieldOrder FGLPROFILE entry is ignored.

The UNCONSTRAINED option can only be supported in TUI mode, with a simple form layout. It is not recommended to use this option in GUI mode.

The FIELD ORDER FORM option instructs interactive instructions to use the tabbing order defined by the TABINDEX attributes of the current form fields. With this option, tabbing order can be defined in the layout of the form, independently from the program instruction. This is the preferred way in GUI mode. When FIELD ORDER FORM is used, the Dialog.fieldOrder FGLPROFILE entry is ignored.

Example

Form "form1.per":

LAYOUT
GRID
{
  First name:  [f001            ] Last name:   [f002            ]
  Address:     [f003                                            ]
}
END
END

ATTRIBUTES
EDIT f001 = FORMONLY.fname, TABINDEX = 2;
EDIT f002 = FORMONLY.lname, TABINDEX = 1;
EDIT f003 = FORMONLY.address, TABINDEX = 0;
END
Module "main.4gl":
MAIN
  DEFINE rec RECORD
             fname VARCHAR(20),
             lname VARCHAR(20),
             address VARCHAR(50)
         END RECORD

  OPTIONS INPUT WRAP

  OPEN FORM f1 FROM "form1"
  DISPLAY FORM f1

  OPTIONS FIELD ORDER CONSTRAINED
  INPUT BY NAME rec.*

  OPTIONS FIELD ORDER UNCONSTRAINED
  INPUT BY NAME rec.*

  OPTIONS FIELD ORDER FORM
  INPUT BY NAME rec.*

END MAIN