Start of Content Area

Background documentation Data Binding for DropDownByKey Element  Locate the document in its SAP Library structure

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 list box 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 and to Key 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 a simple data type in the Java Dictionary.

       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 that 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 displayed in the browser as the result of the declarative design time definitions.

This graphic is explained in the accompanying text

See Event Parameters and Parameter Mapping.

 

 

End of Content Area