%ZEN.Component.dataCombodataCombo is a specialized type of abstractComboBox that presents the user with a set of options that are provided by querying the database.
Contents of the dataCombo DropdownThe contents of the dataCombo dropdown are provided by creating, executing, and fetching from a %ResultSet object on the server.
Initially the contents of the dropdown are empty until the user causes the dropdown to appear at which point a call to the server is made to fetch the dropdown contents. You can change this behavior by setting the cached property.
You can specify how this %ResultSet object is created using the properties inherited from the querySource class.
The number of columns returned by the %ResultSet determines what is displayed within the dropdown list in the following way:
- If the %ResultSet has one column, then the contents of this column are used as both the logical and display values within the dropdown.
- If the %ResultSet has two (or more) columns, then the contents of the first column supply the logical value and the contents of the second column supply the display values. You can change which columns are used to provide the logical and display values using the valueColumn and choiceColumn properties.
- If the %ResultSet has more than two columns, then you can use the displayColumns and columnHeaders properties to specify that the dropdown should display multiple columns (only one column will be used for a display value).
Logical and Display ValuesA combobox has two current values: a logical value (its internal value returned by the getValue() method), and a display value (the value displayed to the user). (In some cases, the logical and display values may be the same).
Unlike a traditional HTML select control, the ZEN dataCombo does not contain every possible logical/display value within its dropdown list. Instead it constructs the contents of its dropdown list on demand. This behavior makes it much better suited for database applications (where the set of possible values can be long and unwieldy).
When an application sets the value of a dataCombo control, it s