Development tools : XUI editor : Editing an XUI page : Editing the properties of the XUI widgets : Binding data to the XUI widgets : Binding data to widgets : Binding data to a select widget
  
Binding data to a select widget
This section provides an example of how to bind data to a select widget.
To define data structure
1 If you get data from context:
You need to specify data structure as following, an IndexedCollection data which includes a KeyedCollection Data, then there are two fields, field labelselect is for lable of select widget, field valueselect is for value of select widget.
Every IndexedCollection data must have at least one kColl data type as a root data container.
This graphic is described in the surrounding text.
Specify the submitted data for the select widget. For example, it can be selectData.selectName.
This graphic is described in the surrounding text.
2 If you get data from list files: You need to create a new javascript file in your project directory /WebContent/listFiles, for example: normal.js, the content is like:
{
'A label' : 'VAL1',
'Another label here' : 'VAL2',
'Label 0001' : 'Value0001',
'Label 0002' : 'Value0002',
'Label 0003' : 'Value0003',
'Label 0004' : 'Value0004',
'Label 0005' : 'Value0005'
}
3 Specify properties for select widget. To get data from list files, specify a value for urlForList; to get data from context data, specify a value for dataNameForList, labelField and valueField. Specify dataName for either of the two modes, which is the submitted value for select widget.
This graphic is described in the surrounding text.
Result
Data is bound to the select widget.
Go up to
Binding data to widgets