Show TOC Start of Content Area

Object documentation DropDownByIndex This graphic is explained in the accompanying text  Locate the document in its SAP Library structure

The Web Dynpro class DropDownByIndex , which implements the IWDDropDownByIndex interface, is the base class of the dropdown list boxes for which index binding is used.

Definition

A DropDownByIndex 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 entry already selected is displayed in the text field. When selecting the button, a list with all possible values is displayed.

Visual Display:

This graphic is explained in the accompanying text

Note

When using a dropdown list box, always display this UI element alongside a label to ensure accessibility.

Description of UI Element Properties

      explanation

specifies the explanation text. explanation is maintained by the documentation developer in the Web Dynpro Authoring environment.

      labelFor

The DropDownByIndex element can also be used as a label for other UI elements. You can use the labelFor property to reference to a UI element.

      readOnly

specifies whether the user can select an element.

      selectionChangeBehaviour

The change of the lead selection can cause a data loss – for example, if the changed or new data was not written to the context due to syntax errors. You can avoid the data loss using the selectionChangeBehaviour property before changing the lead selection:

auto

If the data was written to the context, the value auto specifies that the DropDownByIndex automatically changes the lead selection of its data source directly after an interaction by the user before the corresponding event is triggered.   

manual

Specifies that the DropDownByIndex does not change the lead selection of its data source after an interaction by the user but triggers the corresponding event. In this case, the event handler must change the lead selection to enable the DropDownByIndex to display the data in a main detail view, for example. This setting allows you to check the change of the lead selection.

      size

This property is deprecated and can no longer be used.

      state

displays the status of the DropDownByIndex. The stateproperty can take the following values and is represented by enumeration type WDState.

       normal

       required. The required state will be displayed by an asterisk.

      textDirection

Specifies the text direction. This enables the labels for the DropDownByIndex to be read in other languages that require a specific text direction. The textDirection property can take the following values and is represented by enumeration type WDTextDirection.

inherit

The text direction is inherited from the parent element. The text direction is thus identical to that of the parent element.

ltr

The text runs from left to right.

rtl

The text runs from right to left.

The default value for this property is inherit.

      texts

Specifies the path to the context attribute that provides the texts for the DropDownByIndex. The context attribute must be an attribute of a multiple context node which stores the data.

      width

Determines the width of the DropDownByIndex. You can specify this in CSS sizes, such as em, ex, pixels or percentage values.

Properties Overview

Name

Interface

Type

Initial Value

Bindable

enabled

IWDUIElement

boolean

true

bindable

explanation

IWDDropDownByIndex

String

 

not_bindable

labelFor

IWDAbstractDropDown

String

 

not_bindable

readOnly

IWDAbstractDropDown

boolean

false

bindable

selectionChangeBehaviour

IWDAbstractDropDownByIndex

WDLeadSelectionChangeBehaviour

auto

not_bindable

state

IWDAbstractDropDown

WDState

normal

bindable

textDirection

IWDAbstractDropDown

WDTextDirection

inherit

bindable

texts

IWDAbstractDropDownByIndex

String

 

bindable_mandatory

tooltip

IWDUIElement

String (TranslatableText)

 

bindable

visible

IWDUIElement

WDVisibility

visible

bindable

width

IWDAbstractDropDown

String

 

bindable

Events

      onSelect

This event is triggered when the user selects a different list entry from the dropdown box.
The newly selected index (starting from zero) is passed as an event parameter.

Event Parameter

Type

Description

index

int

Index of the newly selected context element

 

Data Binding

For further information, refer to Data Binding of a Dropdown List Box and Radio Button Group and Code Examples for Data Binding.

 

End of Content Area