!--a11y-->
Web
Dynpro AbstractDropDownByKey API - IWDAbstractDropDownByKey 
The AbstractDropDownByKey class which implements the IWDAbstractDropDownByKey interface is the abstract base class of all
dropdown list boxes that use the
Key Binding
Model for data
binding.
The dropdown listbox offers a selection list to the user from which to choose one or no entry; it consists of a text field, a pushbutton and a selection list. An already selected list entry is displayed in the text field. When selecting the button, a list with all possible values is displayed.
The set of values that can be selected results from the value set of the data type of the attribute to which the selectedKey property is bound. The description for the value is displayed.
The context provides the content to be displayed within the UI element, the corresponding keys and the selected key.
The context must provide the node X that can contain 0 to n elements. (X.cardinality=0..n). The node must contain the attribute y whose data type can contain a value set (set of value/description pairs). The keys of the dropdown listbox are the values of this value set. The texts displayed in the selection list are the respective descriptions. The selected key is provided by the current value of the attribute y.
The selectedKey property of the DropDownByKey UI element is
bound to the attribute y by assigning the path of the context X.y to the
selectedKey property. For further information, refer to
Data Binding of a Dropdown List Box and Radio
Button Group. For a
code example, refer to
Key
Binding.
1. Insert the DropDownByIndex UI element into the TestView (see 1).
2. Define in the Java Dictionary a simple data type.
3. Define the values and the respective descriptions (see table under 3) for this data type. Then create the context structure, as described in step 3.
4. Within any context structure, define a value attribute y of a simple data type, which contains the corresponding value set.
5. Bind the property selectedKey to the value attribute y with path <path>.y.
Step 5 shows the dropdown list box with the possible values Small, Medium, and Large, as it is displayed in the browser as the result of the declarative design time definitions.

·
selectedKey
Use this property to
determine the value from the value set, which is to be selected from the list
of the dropdown listbox.
Name |
Interface |
Type |
Initial Value |
Bindable |
Value Required |
IWDUIElement |
boolean |
true |
bindable |
No |
|
AbstractDropDown |
boolean |
false |
bindable |
No |
|
selectedKey |
IWDAbstracDropDownByKey |
String |
|
bindable_mandatory |
Yes |
IWDAbstractDropDown |
WDState |
normal |
bindable |
No |
|
IWDUIElement |
String (TranslatableText) |
|
bindable |
No |
|
IWDUIElement |
WDVisibility |
visible |
bindable |
No |
|
IWDAbstractDropDown |
String |
|
bindable |
No |
·
onSelect
This property can assign the
action to be executed when the user selects a list entry from the dropdown
list box.
Event Parameter |
Type |
Description |
key |
String |
Key of the selected entry. |
See Event Parameter and Parameter Mapping.
Method Name |
Parameter |
Return Value |
Short Description |
bindingOfSelectedKey |
|
String |
Returns the path of the context element to which the selectedKey property is bound. Returns NULL if no binding exists. |
bindSelectedKey |
(String path) |
|
Binds the value of the selectedKey property to the context element specified by the path. |
getOnSelect |
|
IWDAction |
Returns the action that is executed when the onSelect event is triggered. |
getSelectedKey |
|
String |
Returns the value of the selectedKey property. |
mappingOfOnSelect |
|
IWDParameterMapping |
Returns the parameter mapping for the onSelect action. |
setOnSelect |
(IWDAction action) |
|
Sets the action that is executed when the onSelect event is triggered. |
setSelectedKey |
(String value) |
void |
Sets the value of the selectedKey property. |
Additional methods described in the following APIs are available using inheritance: IWDAbstractDropDown, IWDUIElement, IWDViewElement.

For detailed documentation of all inherited methods, see the documentation for the relevant APIs.
