The
selectedIndexItem property
applies to a VGUIRecord
field that contains an array. The value of the property is the name
of a
selected
index item, which is another VGUIRecord field whose value indicates
two
aspects of runtime processing:
- Whether a control (such as a
check box) is pre-selected when the web page
is displayed
- Whether the user selected a control
The field to which the property refers must be a NUM type and must
not
have decimal places, but can be an array.
Consider the following
case:
- A VGUI record field is an array and has a selectedIndexItem property
that refers to a field (the selected index item) that is not an array
- The uiType property is input or inputOutput
In this case, the generated web page contains radio buttons
from which
the user can choose only one value. The selected index item identifies
the
radio button by number, with the number 1 referring to the first radio
button.
If the selected index item is an array in the same case,
the generated
web page contains a set of checkboxes, and the following is true:
- When data is being prepared for display, the array contains the
indexes
of the entries to be set as preselected
- When data is returned,
the array contains the indexes of the entries that
the user selected. For example, if the user selected displayed entries
with
indexes 1, 3, and 5, for example, the first element of the array contains
1, the second element contains 3, the third contains 5, and the rest
contain
0.
The generated HTML is different if the
uiType property
is
output:
- If the selected index
item is not an array, the generated web page contains
a pair of structures--the label, which is displayed in boldface, and
an HTML <SELECT>
structure (seen as a drop-down list), from which the user can choose
one value.
If the selected index item has a value of 2, for example, the second
entry
is preselected.
- If the selected index item is an array, the
generated web page contains
a similar pair of structures, but the user can choose multiple values.
If
the value of the first element in the selected index item is 1 and
the value
of element 2 is 3, the browser displays a drop-down list, and the
first and
third entries are preselected.