A multi line region for displaying text. Text in the component is restricted to a single font, size and style unless set with HTML commands.
The label control works similar to textView control. In addition a label has an associated component like an inputField or listBox. The label control can be for client side eventing. See the EventValidationComponent description for more details.
· design
Defines the appearance of the label. The CSS controls how the different options are rendered. The following description is based on the standard CSS delivered.
¡ LABEL
Text size and attributes STANDARD
¡ LABELSMALL
Text size -2 in comparison to STANDARD
· enabled - inherited from EventValidationComponent.
A boolean value that enables (=true) or disables (=false) the label control. A disabled label has a different text color to show the user that it is disabled.
· encode
A boolean value that defines how the label text is interpreted. HTML text formatting commands (for example, <h1>, <i> etc.) can be used to change the display of the text. If there are no formatting commands in the text string, the encode attribute has no effect.
Example:
text="<h1><i>Important</i></h1>"
encode = "false" Browser output:
the text string is rendered by interpreting the formatting commands.
encode = "true" Browser output:
the formatting commands are displayed and not interpreted.
· hasDesignBar
Enables or disables a design bar around the label.
· id
Identification name of the label.
· jsObjectNeeded - inherited from Component.
A boolean value that defines if a JavaScript object has to be generated for the inputField component.
· labelFor
Identification name of the next component, which is associated with the label.
· required
A boolean value. If set to "true" a character (for example, an asterisk (*) in red color) defined by the style sheet is placed at the end of the text string. This is a common method to indicate that input is required. See also inputField.
· text
Defines the string of text displayed. See 'encode' for a formatting example with embedded HTML commands.
· tooltip
Defines the hint of the label which is displayed as the mouse cursor passes over the label, or as the mouse button is pressed but not released.
· valid
Defines the status of the associated input field.
· width
Defines the width of the label. The width shows only effect when the 'wrapping' attribute is set to "true". Otherwise the width and layout follows the HTML commands in the text string.
· wrapping
A boolean value. If set to "true" the text is word wrapped at the set 'width' or - if no 'width' is set - at the form width.
Attributes |
M |
Values |
Usage |
design |
|
LABEL |
Taglib Classlib |
enabled |
|
FALSE |
Taglib
Classlib |
encode |
|
FALSE |
Taglib
Classlib |
hasDesignBar |
|
FALSE (d) |
Taglib
Classlib |
id |
* |
String (cs) |
Taglib
Classlib |
jsObjectNeeded** |
|
FALSE (d) |
Taglib
Classlib |
labelFor |
* |
String (cs) |
Taglib
Classlib |
required |
|
FALSE (d) |
Taglib
Classlib |
text |
|
String |
Taglib
Classlib |
tooltip |
|
String |
Taglib
Classlib |
valid |
|
FALSE |
Taglib
Classlib |
width |
|
Unit (100%) |
Taglib
Classlib |
wrapping |
|
FALSE (d) |
Taglib
Classlib |
* Method is inherited from the EventValidationComponent component.
** Method is inherited from the Component component.
See the JavaScript API description for details how to access the component in JavaScript.
using the taglib
<hbj:label |
using the classlib
Form form = (Form) this.getForm(); |