bound-choice
A HTML content command that allows a <select>
element to have its selection modify a Screen data variable.
The primary attribute expression of this command should refer to a Screen data variable, whose value the host <select>
element's selection will then become. If the primary attribute expression can be resolved into a Picklist value in the variable context, the attributes bound-choice-options, bound-choice-option-value and bound-choice-option-label are automatically given appropriate values by the command and should therefore be left undefined.
Attributes
bound-choice | ||
---|---|---|
Required | Value type | EL-evaluated |
Yes | String | |
Defines the variable where the selected option is stored. |
bound-choice-options | ||
---|---|---|
Required | Value type | EL-evaluated |
Yes | Collection | |
Defines the set of options the selection will display. The resolved Collection value is expected to contain Maps, Data items or Strings. In case of Maps or Data items, it is recommended to set values for both bound-choice-option-value and bound-choice-option-value to define how the values and labels of the options are formed. |
bound-choice-option-value | ||
---|---|---|
Required | Value type | EL-evaluated |
No | String | |
If the option items in the options Collection are Maps or Data items, this attribute should be used to define which entry of an item provides the value of its option. The option's value is what can be set as the value of the Screen data variable specified with the primary attribute. The resolved value should be a key common to all the Collection items - the value behind the key is then used as the option value. This attribute should be left undefined if the options Collection contains Strings |
bound-choice-option-label | ||
---|---|---|
Required | Value type | EL-evaluated |
No | String | |
If the option items in the options Collection are Maps or Data items, this attribute should be used to define which entry of an item provides the label of its option. The label is how the option is displayed to the users. The resolved value should be a key common to all the Collection items - the value behind the key is then used as the option label. This attribute should be left undefined if the options Collection contains Strings |
bound-choice-option-grouping | ||
---|---|---|
Required | Value type | EL-evaluated |
No | String | |
If the option items in the options Collection are Maps or Data items, this attribute can be used to define how the options are grouped. The resolved value should be a key common to all the Collection items - all the option items with the same value behind this key are then grouped together in the selection. If not defined, the options are not grouped. |
Examples
Using bound-choice as a child command of a bound-repeat:
CODE<div dyn-bound-repeat="oppLineItems" dyn-bound-repeat-var="item"><select dyn-bound-choice="item.Id" dyn-bound-choice-option-label="'Name'" dyn-bound-choice-options="oppLineItems"></select></div>
Using bound-choice as a standalone command:
CODE<select dyn-bound-choice="selectedOpp" dyn-bound-choice-option-label="'Name'" dyn-bound-choice-options="oppLineItems"></select>