Skip to main content
Version: v10.15

Configuring Select Widget using Display and Data Fields

A Select widget can be used in various ways based on the source of data. Each type of data source needs a different approach. WaveMaker Select widget works in any one of the following ways:

Usually, when giving options to the user, one would want the option to make sense to the user while using a totally different value internally within the application. For example, the user may select Male/Female but the value stored could be M/F or 0/1. To cater for such needs, WaveMaker Studio offers an Entry type while creating a Model Variable. Using this option, the developer can specify different fields for the variable – one called dataValue and other called name. For example, you want the user to select gender as Male or Female, but want to use M or F internally.

  1. Drag and drop a Select and Label widget onto the canvas.
  2. Create a Model Variable, choose Entry Type
  3. Select the Is List and add the list values. you can also use the text editor to enter the values in JSON format:
  4. Bind the dataset of the Model Variable to the select widget
  5. Set the Datafield property to the dataValue and Display Field to the name fields of the static variable. Set the Default Value, note the default value should correspond to the dataValue and not the name field of the static variable.
  6. The selection made by the user is displayed in a Label widget, by binding the select datavalue to it.
  7. Preview the app and see the selected item from the Select widget displayed in the label.

Select Use Cases