Label

Use

The Label UI element is used to label other UI elements. It is always associated, therefore, with another UI element. You can use a Label for the following UI elements:

  • BreadCrumb

  • Caption

  • CheckBox and CheckBoxGroup

  • DropDownByKey and DropDownByIndex

  • FileDownload and FileUpload

  • FormattedTextEdit and FormattedTextView

  • Image

  • InputField

  • ItemListBox

  • LinkToAction and LinkToUrl

  • ProgressIndicator

  • RadioButton, RadioButtonGroupByIndex, and RadioButtonGroupByKey

  • Table

  • TextEdit and TextView

  • ThresholdSlider

  • TransparentContainer

  • TriStateCheckBox

The appearance of a Label is defined by the design property.

If the assigned UI element has the status required, this is indicated by a small red star to the right of the label text.

With an inactive UI element (enabled=false) the label is also indicated as inactive.

If the assigned UI element has an explanation text and the help mode is activated, this is indicated by a small i to the right of the label text. When you move the mouse over the label, the text is displayed.

By clicking on the label, the assigned UI element is activated (dropdown* UI elements and input fields are focused, check boxes toggled and radio buttons selected).

Depending on the size of the browser window and the browser used, functions for Truncating Contents are available for Labels in a FormLayout:

This UI element supports the accessibility of the Web Dynpro application.

Example of the Display with an InputField

Implementation Details

Runtime Class CL_WD_LABEL

Properties in View Designer

For more information, see Label Properties.

Name Type Initial Value Bindable
id STRING (automatic) No
contextMenuBehaviour WDUI_CONTEXT_MENU_BEHAVIOUR inherit No
contextMenuId WDY_MD_UI_ELEMENT_REFERENCE No
design

WDUI_LABEL_DESIGN

standard Yes
editable

WDY_BOOLEAN

false Yes
enabled

WDY_BOOLEAN

true Yes
labelFor

WDY_MD_UI_ELEMENT_REFERENCE

No
styleClassName STRING Yes
text Translatable text Yes
textDirection WDUI_TEXT_DIRECTION inherit Yes
tooltip Translatable text Yes
visible WDUI_VISIBILITY visible Yes
width STRING Yes
wrapping WDY_BOOLEAN false Yes

Events in View Designer

Name

onChange

Dynamic Programming

For dynamic programming, the same properties, events, and aggregations as in the View Designer are available. But note that the spelling format and use of upper/lower case is different.

Dynamic Programming of Properties

View Designer Name

Runtime Name

Type

contextMenuBehaviour

CONTEXT_MENU_BEHAVIOUR

WDUI_CONTEXT_MENU_BEHAVIOUR

contextMenuBehaviour: inherit

CL_WD_LABEL=>E_CONTEXT_MENU_BEHAVIOUR-INHERIT

contextMenuBehaviour: provide

CL_WD_LABEL=>E_CONTEXT_MENU_BEHAVIOUR-PROVIDE

contextMenuBehaviour: suppress

CL_WD_LABEL=>E_CONTEXT_MENU_BEHAVIOUR-SUPPRESS

contextMenuId

CONTEXT_MENU_ID

WDY_MD_UI_ELEMENT_REFERENCE

design

DESIGN

WDUI_LABEL_DESIGN

design: emphasized

CL_WD_LABEL=>E_DESIGN-EMPHASIZED

design: light

CL_WD_LABEL=>E_DESIGN-LIGHT

design: standard

CL_WD_LABEL=>E_DESIGN-STANDARD

enabled

ENABLED

WDY_BOOLEAN

labelFor

LABEL_FOR

WDY_MD_UI_ELEMENT_REFERENCE

styleClassName STYLE_CLASS_NAME STRING

text

TEXT

WDY_MD_TRANSLATABLE_TEXT

textDirection

TEXT_DIRECTION

WDUI_TEXT_DIRECTION

textDirection inherit

CL_WD_LABEL=>E_TEXT_DIRECTION-INHERIT

textDirection: ltr

CL_WD_LABEL=>E_TEXT_DIRECTION-LTR

textDirection: rtl

CL_WD_LABEL=>E_TEXT_DIRECTION-RTL

tooltip

TOOLTIP

WDY_MD_TRANSLATABLE_TEXT

visible

VISIBLE

WDUI_VISIBILITY

visible: none

CL_WD_LABEL=>E_VISIBLE-NONE

visible: visible

CL_WD_LABEL=>E_VISIBLE-VISIBLE

width

WIDTH

STRING

wrapping

WRAPPING

WDY_BOOLEAN

Example

You can find examples of this interface element in the system in the WDR_TEST_UI_ELEMENTS Web Dynpro application and in the WDR_TEST_EVENTS component in the InputField view.