Drop List
A drop list is a combination of a text object and a list box. The drop list allows the user to select a single option from a list of available options. Each option is defined by its index, assigned value and the text displayed in the drop list. The list of options displayed in the drop list is defined in the text list that is bound to the drop list. When an option is selected, the index of the selected option in the drop list is returned and the value assigned to the selected text list entry can be written to a connected variable (HMI tag).
The 'Drop List' category of the 'Properties' tab of the drop list object provides the properties described in the following table:
Example of Drop List properties
Drop List property | Description |
---|---|
Text list | Text list to which the drop list is bound. In the text list, the data for the drop list options (text, value etc.) are defined. |
Selected index | The selected numeric variable provides the zero-based index of the selected option at runtime. If no variable is selected, the value is -1. The first option in a drop list (text list) starts at index 0. |
Selected identifier variable | Variable to which the value of the currently selected option is written. The value to be written is the 'Write Value' entered for the selected option in the bounded text list. |
Padding | Defines the space between the drop list element and its options (default value: 24). |
Drop List object at runtime
- The object is collapsed when initially loaded. The drop list can be expanded or collapsed using the button on the right hand side.
- When an option is selected from the list, the list is collapsed. Clicking elsewhere also collapses the list.
Configuring a drop list
To configure a drop list object, proceed as follows:
- If not yet done, create a text list with the options to be displayed in the drop list as described in the topic "Working with Text Lists".
Note
In the text list to be connected to the drop list object, the start value and the end value of a text list entry must be equal. - Create a new HMI page or open an existing page.
- In the COMPONENTS area under the 'HMI' category, open the 'Objects' group and drag the 'Drop List' object into the HMI page.
- In the 'Drop List' category of the 'Properties' tab of the drop list object, assign the desired text list with the drop list options to be displayed to the 'Text List' property. Optional, assign a variable (HMI tag) to the 'Selected Index variable' and 'Selected Identifier variable' properties.