Show TOC

 DropDownByKeyLocate this document in the navigation structure

A DropDownByKey UI element provides the user with a dropdown list box. You cannot select more than one entry from the selection list. The UI element consists of a text field, a button, and a selection list. Any list item already selected is displayed in the text field. When the user chooses the pushbutton, a list of all possible values is displayed.

If you want to create a DropDown list in which some entries are available in multiple, use DropDownByKey.

Note

To enable the development of accessible applications the label property is checked during the syntax check.

If no label has been set, and no descriptive text has been specified for the appropriate bound context element in the ABAP Dictionary, the tooltip property is checked.

Examples of the Display

The dropdown list box UI elements, DropDownByKey and DropDownByIndex , do not differ from each other when displayed on the screen. However, the data binding model for the DropDownByIndex UI element has a completely different concept. The displayed texts are those from the ValueSet or the ABAP Dictionary domain values of the attribute to which the property selectedKey is linked.

See Data Binding within Web Dynpro generally, and Data Binding of UI Element Properties and Data Binding of a Dropdown Listbox . You can find more information about using dropdown list boxes with index data binding in AbstractDropDownByKey .

Runtime Class

CL_WD_DROPDOWN_BY_KEY

Properties in the View Designer

Name Type Initial Value Bindable

ID

STRING

(automatic)

No

activateAccessKey

WDY_BOOLEAN

false

No

contextMenuBehaviour

WDUI_CONTEXT_MENU_BEHAVIOUR

inherit

No

contextMenuId

WDY_MD_UI_ELEMENT_REFERENCE

No

enabled

WDY_BOOLEAN

true

Yes

explanation

Translatable text

No

keyVisible

WDY_BOOLEAN

false

Yes

labelFor

WDY_MD_UI_ELEMENT_REFERENCE

No

readOnly

WDY_BOOLEAN

false

Yes

selectedKey

STRING

Mandatory

state

WDUI_STATE

normal

Yes

textDirection

WDUI_TEXT_DIRECTION

inherit

Yes

tooltip

Translatable text

Yes

visible

WDUI_VISIBILITY

visible

Yes

width

STRING

Yes

Events in the View Designer

Name

onSelect

Other properties that can be inherited are defined in the associated higher-level classes. The associated UI elements are:

  • AbstractDropDownByKeysapurl_link_0002_0022_0041
  • AbstractDropDownsapurl_link_0002_0023_0041
  • UIElementsapurl_link_0002_0024_0041
  • ContextMenuProvidersapurl_link_0002_0025_0041
  • ViewElementsapurl_link_0002_0026_0041
Dynamic Programming

For dynamic programming, the same properties, events, and aggregations as in the View Designer are available. Bear in mind the different spellings.

Note

Note that when you program value lists dynamically in context (NODE_INFO->SET_ATTROBUTE_VALUE_SET() ), that you have to insert a CONDENSE if you use integer types for an attribute.

Dynamic Programming of Properties

View Designer Name Runtime Name Type

activateAccessKey

ACTIVATE_ACCESS_KEY

WDY_BOOLEAN

contextMenuBehaviour

CONTEXT_MENU_BEHAVIOUR

WDUI_CONTEXT_MENU_BEHAVIOUR

 contextMenuBehaviour: inherit

CL_WD_DROPDOWN_BY_KEY=>E_CONTEXT_MENU_BEHAVIOUR-INHERIT

 contextMenuBehaviour: provide

CL_WD_DROPDOWN_BY_KEY=>E_CONTEXT_MENU_BEHAVIOUR-PROVIDE

 contextMenuBehaviour: suppress

CL_WD_DROPDOWN_BY_KEY=>E_CONTEXT_MENU_BEHAVIOUR-SUPPRESS

contextMenuId

CONTEXT_MENU_ID

WDY_MD_UI_ELEMENT_REFERENCE

enabled

ENABLED

WDY_BOOLEAN

explanation

EXPLANATION

WDY_MD_TRANSLATABLE_TEXT

keyVisible

KEY_VISIBLE

WDY_BOOLEAN

labelFor

LABEL_FOR

WDY_MD_UI_ELEMENT_REFERENCE

readOnly

READ_ONLY

WDY_BOOLEAN

selectedKey

SELECTED_KEY

STRING

state

STATE

WDUI_STATE

 state: normal

CL_WD_DROPDOWN_BY_KEY=>E_STATE-NORMAL

 state: required

CL_WD_DROPDOWN_BY_KEY=>E_STATE-REQUIRED

textDirection

TEXT_DIRECTION

WDUI_TEXT_DIRECTION

textDirection inherit

CL_WD_DROPDOWN_BY_KEY=>E_TEXT_DIRECTION-INHERIT

textDirection ltr

CL_WD_DROPDOWN_BY_KEY=>E_TEXT_DIRECTION-LTR

textDirection rtl

CL_WD_DROPDOWN_BY_KEY=>E_TEXT_DIRECTION-RTL

tooltip

TOOLTIP

WDY_MD_TRANSLATABLE_TEXT

visible

VISIBLE

WDUI_VISIBILITY

visible: none

CL_WD_DROPDOWN_BY_KEY=>E_VISIBLE-NONE

visible: visible

CL_WD_DROPDOWN_BY_KEY=>E_VISIBLE-VISIBLE

width

WIDTH

STRING

Dynamic Programming of Events

View Designer Name Runtime Name

onSelect

ON_SELECT

Example

There is a system example for this UI element in the DEMO_UIEL_STD_SELECTION component in the DEMO_UIEL_DROPDOWN_BY_KEY application.