10. JSF HTML Tag Reference
Contents > JSF HTML Tag Reference > h:outputLabel
h:outputLabel |
|
The outputLabel tag renders an HTML "label" element. It allows you to customize the appearance of the label using CSS styles. The outputLabel component is associated with another component via its "for" attribute. The other component must be created before the outputLabel component when the JSF page is rendered.
Note the use of the panelGroup container in the example below. The panelGroup component renders its children, allowing the outputLabel component to locate the inputText component at render time.
Example
<h:panelGroup>
<h:outputLabel id="usernameLabel" for="username" value="#{bundle.usernameLabel}" />
<h:inputText id="username" value="#{userBean.user.username}}" />
<h:panelGroup>
HTML Output
<label id="form:usernameLabel" for="form:username">Username</label>
<input id="form:username" name="form:username" type="text" value=""/>
|
Tag Attributes
| accesskey |
Text |
| |
| The accesskey attribute is a standard HTML attribute that sets the access key that transfers focus to this element when pressed. |
| binding |
Expression |
| |
| The value-binding expression linking this component tag to a backing bean property. |
| converter |
Text |
| |
| The converter attribute sets the converter instance to be registered for this component. It must match the converter-id value of a converter element defined in your Faces configuration file. |
| dir |
Enumerated |
| |
| The dir attribute is a standard HTML attribute that overrides the default text directionality for this component. The values accepted for this component are "LTR" (left-to-right) and "RTL" (right-to-left). |
| for |
Text |
| |
| The for attribute identifies the component for which to generate a label element. |
| id |
Text |
| |
| The unique identifier value for this component. The value must be unique within the closest naming container. |
| lang |
Text |
| |
| The lang attribute is a standard HTML attribute that sets the code describing the language to be used in the markup generated by this component. |
| onblur |
Text |
| |
| The onblur attribute sets the JavaScript code to execute when this element loses focus. |
| onclick |
Text |
| |
| The onclick attribute sets the JavaScript code to execute when the mouse pointer is clicked over this element. |
| ondblclick |
Text |
| |
| The ondblclick attribute sets the JavaScript code to execute when the mouse pointer is double-clicked over this element. |
| onfocus |
Text |
| |
| The onfocus attribute sets the JavaScript code to execute when the element receives focus. |
| onkeydown |
Text |
| |
| The onkeydown attribute sets the JavaScript code to execute when a key is pressed down over this element. |
| onkeypress |
Text |
| |
| The onkeypress attribute sets the JavaScript code to execute when a key is pressed and released over this element. |
| onkeyup |
Text |
| |
| The onkeyup attribute sets the JavaScript code to execute when a key is released over this element. |
| onmousedown |
Text |
| |
| The onmousedown attribute sets the JavaScript code to execute when the mouse pointer is pressed down over this element. |
| onmousemove |
Text |
| |
| The onmousemove attribute sets the JavaScript code to execute when the mouse pointer is moved within this element. |
| onmouseout |
Text |
| |
| The onmouseout attribute sets the JavaScript code to execute when the mouse pointer is moved away from this element. |
| onmouseover |
Text |
| |
| The onmouseover attribute sets the JavaScript code to execute when the mouse pointer is moved onto this element. |
| onmouseup |
Text |
| |
| The onmouseup attribute sets the JavaScript code to execute when the mouse button is released over this element. |
| rendered |
Boolean |
| |
| A value-binding expression that evaluates to a Boolean condition indicating if this component should be rendered. |
| style |
CSS Style |
| |
| The style attribute sets the CSS style definition to be applied to this component when it is rendered. |
| styleClass |
CSS Class |
| |
| The styleClass attribute sets the CSS class to apply to this component when it is rendered. |
| tabindex |
Text |
| |
| The tabindex attribute is a standard HTML attribute that sets the order in which this element receives focus when the user cycles through the elements using the TAB key. The value for this attribute must be an integer between 0 and 32767. |
| title |
Text |
| |
| The title attribute is a standard HTML attribute that sets the tooltip text to display for the rendered component. |
| value |
Text |
| |
| The value attribute sets the current value for this component. |
|