!--a11y-->
Web Dynpro AbstractDropDownByKey API -
IWDAbstractDropDownByKey 
The AbstractDropDownByKey UI element is the abstract class of a dropdown list box that usese the Key Data Binding Model for data binding. It provides a selection list from which the user can select one or no entry. The UI element consists of a text field, a button, 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 keys for an element in the selection list.
The context provides the node X that can contain 0 to n elements. (X.cardinality=0..n). The node contains the attribute y whose data type can contain a value set (value discription pair). The key of the dropdown list box are the keys of this value set. The texts displayed are the corresponding values of these keys. The selected key is identical to 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.
Design Time:
After you insert the DropDownByKey UI element as a container child of the TestView view (step 1), you define a simple data type in the Java Dictionary. The simple data type contains the values and the corresponding descriptions (see table in step 3). You create the context structure, as described in step 3.
This can be any context structure and within this structure, you define a value attribute y of a simple data type, which contains the corresponding value set. This is followed by the data binding of the DropDownByKey UI element in the Properties window of the View Designer. The property selectedKey must be bound to the value attribute y with the path <path>.y.
Runtime:
Step 4 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 descriptions.

·
selectedKey
This property can bind data to the UI element and
assign the path to the context attribute within the hierarchical context
structure.
|
Name |
Class |
Type |
Initial Value |
Bindable |
Value Required |
|
UIElement |
Boolean |
true |
bindable |
No |
|
|
selectedKey |
AbstracDropDownByKey |
String |
|
bindable_mandatory |
Yes |
|
AbstractDropDown |
State |
normal |
bindable |
No |
|
|
UIElement |
TranslatableText |
|
bindable |
No |
|
|
UIElement |
Visibility |
visible |
bindable |
No |
|
|
AbstractDropDown |
String |
|
bindable |
No |
·
onSelect
This property can assign the action to be executed
when the user selects a different 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 further information about all inherited methods, refer to the documentation for the relevant APIs.
