The data returned from a host
program for a Combo Box Web component can be in one of two formats. For example,
assume the combo box is defined in the Attributes view at design time with
three data items named
Apple,
Orange, and
Banana,
and with values of
A,
O, and
B,
respectively.
Banana is set to
True to specify
that it is preselected in the combo box.
- If the value returned from the host program is a single field with a
value of O without a delimiter, the combo box displays the
items originally defined, but the item identified by the value O (Orange in
this example), becomes the preselected item.
- If the value returned is an array with the elements Potato;P;False, Carrot;C;True,
and Tomato;T;False (that is, in key-value-selection format
with delimiters), then the data is treated as dynamic data and it overwrites
the initial data items defined for the combo box. In this case, Carrot,
which is set to True, is the preselected item in the combo
box.
- Delimiter
- Enter the character used to delimit the values of options in the Web component
when dynamic data is used to fill the combo box. The default character is
a semicolon.
- Name
- Enter a name to associate with the assigned value. The name is the actual
choice in the combo box. When the user selects this name, the value associated
with it is sent to the program.
- See Text string substitution for iSeries Web component labels for
information about externalizing text strings for text substitution purposes.
- Value
- Enter the value that is sent to the program when the user selects the
associated name. Note that the length of the value cannot be specified. When
you define the parameter in your procedure to map the value, ensure that it
is defined long enough to contain the longest value. The value is trimmed
to the parameter length. Also note that the value cannot contain the delimiter
character defined in the Delimiter field.
- Selected
- The default is False, which indicates that the items in the selection
box are not pre-selected. To change the value to True, which indicates
that an item is pre-selected, click the Selected field for the item
and select True from the list. More than one item can have a value
of True if Allow multiple select was specified on the General
tab.
- Add
- To add an option, click Add and enter a name and value in the respective
fields. The values for the selected status are False and True.
The default is False.
- Remove
- To delete an option from the list of options, select the option then click Remove.
- Up
- To move an option upwards in the list of options, select the option then
click Up.
- Down
- To move an option downwards in the list of options, select the option
then click Down.