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 Combo widget
  
Binding data to a Combo widget
This section provides an example of how to bind data to a Combo widget.
If you get data from context
1 Define Data Structure:
Define an IndexedCollection data to define the data structure of comboBox as following, label is the data to specify combo label.
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 comboBox. For example, it can be comboData.comboName.
This graphic is described in the surrounding text.
2 Assign values to dataNameForList and labelField. You need to specify dataName for either of the two modes, which is the submitted value for combo widget.
This graphic is described in the surrounding text.
If you get data from list files
1 Prepare a JavaScript file with proper data structure.
For example: /WebContent/listFiles/normal.js is like:Data in the first column is label field and the second column is value field.
This graphic is described in the surrounding text.
2 Specify the JavaScript file path as the value of urlForList.
In this case, you do not need to edit labelField and valueField since they are defined in the JavaScript file.
This graphic is described in the surrounding text.
Result
Data is bound to the combo widget.
Go up to
Binding data to widgets