Defining the tabbing order
Control the order of tabbing through the fields with the TABINDEX
attribute.
When a dialog is executing, the end-user can jump from field to field with the keyboard by using
the Tab and Shift-Tab keys. One can tab out of an INPUT ARRAY
sub-dialog with Ctrl-Tab
and Shift-Ctrl-Tab accelerators (in INPUT ARRAY
, Tab and Shift-Tab loop in the
fields of the current row).
Consider using the OPTIONS INPUT
WRAP
instruction to force the focus to stay in the dialog, when tabbing out of the
last form element controlled by the dialog.
The order in which the fields can be visited with the Tab key can be controlled with a program
option and the TABINDEX
form field attribute.
The FIELD
ORDER
dialog attribute defines the way tabbing order works (it can also be defined
globally with OPTIONS FIELD ORDER mode
). Tabbing order can be
based on the dialog binding list (FIELD ORDER CONSTRAINED
, the default) or it can
be based on the form tabbing order (FIELD ORDER FORM
). It is recommended that you
use the FIELD ORDER FORM
option, to use the tabbing order specified in the form
file.
The TABINDEX
field
attribute allows tabbing order in the form to be defined for each form item. By default,
the form compiler assigns a tabbing index for each form item based on the position of
the item in the layout.
TABINDEX
values must be unique in a form.
Form elements that can get the focus are:
- Simple form fields controlled by
INPUT
orCONSTRUCT
, - Read-only lists or treeviews controlled by
DISPLAY ARRAY
, - Editable list cells controlled by
INPUT ARRAY
, - Simple buttons controlled by a
COMMAND
interaction block.
If you use the keyboard to tab into a form element, the focus will go to the next (or previous) element that is visible and activated. In other words, if a form item is hidden or disabled, it is removed from the tabbing list.
The tabbing position of a read-only list driven by a DISPLAY ARRAY
binding is
defined by the TABINDEX
of the first field.
When TABINDEX
is set to zero, the form item is excluded from the tabbing list.
However, the item with TABINDEX=0
can still get the focus with the mouse (or when
you tap on it on a mobile device).
The NEXT FIELD
instruction can
also use the tabbing order, when executing NEXT FIELD NEXT
and NEXT FIELD
PREVIOUS
.
When moving columns around in a TABLE
or TREE
container, new tab indexes are assigned to columns, so that input
tabbing order corresponds to the visual column order. If the order of the columns in an editable
list shouldn't be changed, freeze the table columns with the UNMOVABLECOLUMNS
attribute
of the TABLE
/TREE
.