Binding data to a combo widget

This section provides an example of how to bind data to a combo widget.

Procedure

Define Data Structure:

  1. If you get data from context.
    1. You need to specify an IndexedCollection data to define the data structure of comboBox as following, label is the data to specify combo label.
      Note: Every IndexedCollection data must have at least one kColl data type as a root data container.
    2. Then you need to specify the submitted data for the comboBox. For example, it can be comboData.comboName.

  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:
    [
    'Label0001',
    'Label0002',
    'Label0003',
    'Label0004',
    'Label0005',
    'Label0006'
    ]
  3. You need to specify properties for combo widget. If you want to get data from list files, you need to specify value for urlForList, if you want to get data from context data, you need to specify value for dataNameForList and labelField. You need to specify dataName for either of the two modes, which is the submitted value for combo widget.

Results

Data is bound to the combo widget.