DropDownBox

Introduction

The DropDownBox control provides a TextField and a list of predefined entries. The DropDownBox control is based on the ComboBox control. Additional features of the DropDownBox control are a history that shows the last-used entries; and the possibility to add a value help. Users can enter values in the text field that are provided by the list. During typing, a possible value is suggested using auto-completion.

Examples

Basic Example

The single items for the DropDownBox are added using the addItem method.

A DropdownBox Using a ListBox

The items are added to a ListBox control which also contains additional texts. The ListBox is referenced by the DropDownBox using the setListBox method. Using a ListBox for the DropDownBox allows a reuse of this ListBox in multiple DropDownBoxes. This is useful for tables, for example, where the possible values are the same in every row.
The change event is assigned to a function that fills the text field next to the DropDownBox. So you can see when the change event is fired. Control creation as well as property assignment in the following example are done using an alternative constructor syntax. The example also shows the history feature.

Data Binding

The items are filled via data binding. The data is bound to the properties using the bindProperty method. Changes on the data model directly change the DropDownBox content.

The Search Help Feature

In this example, a search help is implemented using the Dialog control. The search must result in values available in the list.



Using Item Id and Key

The value of a DropdownBox can be set from the application using the properties value, selectedKey and selectedItemId. So instead of using the value property the value can be set to an item of the Dropdownbox. Additionally it can be determines which item is currently selected. If the properties selectedKey and selectedItemId are set to an invalid value they will not be changed and still have their old value.
In the example you can see how to set and get the DropdownBox value using selectedKey and selectedItemId.


API Documentation

See API documentation