Entering content frame

Object documentation Web Dynpro AbstractDropDownByKey API - IWDAbstractDropDownByKey Locate the document in its SAP Library structure

Definition

The AbstractDropDownByKey class which implements the IWDAbstractDropDownByKey interface is the abstract base class of all dropdown list boxes that use the Structure linkKey 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.

Data Binding

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 Structure linkData Binding of a Dropdown List Box and Radio Button Group. For a code example, refer to Structure linkKey Binding.

Example for Data Binding of the DropDownByKey UI Element:

Procedure at design time:

       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.

Behavior at runtime:

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.

This graphic is explained in the accompanying text

Description of the UI Element Property

·        selectedKey
Use this property to determine the value from the value set, which is to be selected from the list of the dropdown listbox.

Overview of Inherited and Additional Properties

Name

Interface

Type

Initial Value

Bindable

Value Required

enabled

IWDUIElement

boolean

true

bindable

No

readOnly

AbstractDropDown

boolean

false

bindable

No

selectedKey

IWDAbstracDropDownByKey

String

 

bindable_mandatory

Yes

state

IWDAbstractDropDown

WDState

normal

bindable

No

tooltip

IWDUIElement

String (TranslatableText)

 

bindable

No

visible

IWDUIElement

WDVisibility

visible

bindable

No

width

IWDAbstractDropDown

String

 

bindable

No

Events

·        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.

Subordinate Interfaces

IWDDropDownByKey.

Methods in the Web Dynpro IWDAbstractDropDownByKey API

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.

Note

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

  

  

 

Leaving content frame