The DropDownListBox edit style

You can use the DropDownListBox edit style to have columns display as drop-down lists during execution.

Typically, this edit style is used with code tables, where you can specify display values that users see and shorter data values that are stored in the database.

In the DropDownListBox edit style, the display values of the code table display in the ListBox portion of the DropDownListBox. The data values (not the display values) are the values that are put in the DataWindow buffer when the user selects an item in the ListBox portion of the drop-down list. These values are sent to the database when an Update is issued.

For example, when a user selects the value Business Services in Figure 21-3, the corresponding data value could be a department number such as 200.

Figure 21-3: Example of a drop-down list edit style

The sample shows a drop down list labeled Department. Business Services displays as the selected Department value. The arrow for the drop down list has been clicked and a list box showing four possible departments is visible  beneath the Department field. Business service is highlighted in the drop down list.

StepsTo use the DropDownListBox edit style:

  1. Select DropDownListBox from the Style Type box for a DataWindow column.

    The Style Type box is on the Edit page of the Properties view for the column.

  2. Select other properties on the Edit page of the Properties view.

  3. Enter values you want to have appear in the Display Value box and corresponding data values in the Data Value box.

During execution

You can define and modify a code table for a column in a script by using the SetValue function during execution. To obtain the value of a column during execution, use the GetValue function. To clear the code table of values, use the ClearValues function.

For more about code tables, see “Defining a code table”.