Start of Content Area

Object documentation Web Dynpro Label API - IWDLabel  Locate the document in its SAP Library structure

Definition

The Label UI element is used for labeling other UI elements. Therefore, it is always associated with another UI elements.

This UI element ensures accessibility of the Web Dynpro application.

The appearance is defined by the design property. The following table shows how a label UI element for labeling an input field is displayed.

Description of UI Element Properties

·        design
Specifies the design of the UI element. The design property can be filled with the following values and is represented by the enumeration type WDLabelDesign.

emphasized

 

The UI element is highlighted.

light

This graphic is explained in the accompanying text

The UI element is displayed without the left design bar.

standard

This graphic is explained in the accompanying text

A default design of the UI element.

·        labelFor
Specifies the ID of the UI element to be labeled.

·        text
Label text.

·        textDirection
Specifies the text direction and allows you to use Label UI elements for texts in languages which require a specific text direction.
The textDirection property can be filled with the following values and is represented by the enumeration type WDTextDirection.

inherit

The text direction is inherited from the parent element. Therefore, the text direction is identical to the one 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.

·        width
Specifies the width of the Label UI element and can be specified in CSS units like em, ex, pixels, or percentage.

·        wrapping
Indicates whether or not the text is wrapped.
If the value is false, the text is not wrapped.

Data Binding

Since the relationship between Label UI element and associated UI element is specified by the static layout of a view, the labelFor property is not defined as bindable.

Overview of Inherited and Additional Properties

Name

Interface

Type

Initial Value

Bindable

Value Required

enabled

IWDUIElement

boolean

true

bindable

No

design

IWDLabel

WDLabelDesign

standard

bindable

No

labelFor

IWDLabel

String

 

not_bindable

Yes

text

IWDLabel

String (TranslatableText)

 

bindable

No

textDirection

IWDLabel

WDTextDirection

inherit

bindable

No

tooltip

IWDUIElement

String (TranslatableText)

 

bindable

No

visible

IWDUIElement

WDVisibility

visible

bindable

No

width

IWDLabel

String

 

bindable

No

wrapping

IWDLabel

boolean

false

bindable

No

Mobile Characteristics

 

The UI element Label supports the development of mobile applications for pocket PCs, BlackBerry wireless handhelds, and Nokia Series 80 devices (see Mobile Web Dynpro).

However, several properties supported in the desktop browser cannot be used. These include:

Variances of the properties

Properties

Pocket PC

BlackBerry Wireless Handheld

Nokia Series 80 Devices

enabled

ignored

ignored

ignored

tooltip

ignored

ignored

ignored

wrapping

ignored

ignored

supported

 

Methods in the Web Dynpro Label API

Method Name

Parameter

Return Value

Description

bindDesign

(String path)

 

Binds the value of the design property to the context element specified by the path.

bindingOfDesign

 

String

Returns the path of the context element to which the design property is bound. Returns NULL if no binding exists.

bindingOfText

 

String

Returns the path of the context element to which the text property is bound. Returns NULL if no binding exists.

bindingOfTextDirection

 

String

Returns the path of the context element to which the textDirection property is bound. Returns NULL if no binding exists.

bindingOfWidth

 

String

Returns the path of the context element to which the width property is bound. Returns NULL if no binding exists.

bindingOfWrapping

 

String

Returns the path of the context element to which the wrapping property is bound. Returns NULL if no binding exists.

bindText

(String path)

 

Binds the value of the text property to the context element specified by the path.

bindTextDirection

(String path)

 

Binds the textDirection property to the context node specified by a path.

bindWidth

(String path)

 

Binds the value of the width property to the context element specified by the path.

bindWrapping

(String path)

 

Binds the wrapping property to the context node specified by a path.

getDesign

 

WDLabelDesign

Returns the value of the design property.

getLabelFor

 

String

Returns the value of the labelFor property.

getText

 

String

Returns the value of the text property.

getTextDirection

 

WDTextDirection

Returns the value of the textDirection property.

getWidth

 

String

Returns the value of the width property.

getWrapping

 

boolean

Returns the value of the wrapping property.

setDesign

(WDLabelDesign design)

 

Sets the value of the design property.

setLabelFor

(String labelFor)

 

Sets the value of the labelFor property.

setText

(String text)

 

Sets the value of the text property.

setTextDirection

(WDTextDirection textDirection)

 

Sets the value of the textDirection property.

setWidth

(String width)

 

Sets the value of the width property.

setWrapping

(boolean wrapping)

 

Sets the value of the wrapping property.

Additional methods described in the following APIs are available using inheritance: IWDUIElement, IWDViewElement.  

  

 

End of Content Area