See Also
You can drag the Standard JavaServer Faces Component Label component
from
the Palette to the Visual Designer to create a label for another
component. A Component Label associates a label with another
component of your page, providing support for speech browsers
and enabling visual browsers to provide features like the ability
to click a text label to select a radio button or checkbox.
If all you need is simple text not directly associated with
a component, as in a title or a heading or a set of instructions,
use the Static Text component
instead.
- This component is a JavaServer Faces reference implementation that cannot use themes. The Label component in the Basic category of the Palette does support themes and provides other features that improve ease of use.
After dragging the component to the Visual Designer, you can do a number of things
with it:
- Change the displayed text of the component by selecting the the component
and typing the new text. Press Enter to save the text in the component's
value property.
- Select either the text element (inner part) or the label
element (outer part). This component is composed of a
ComponentLabel and an embedded OutputText component.
Depending on where you click this component in the Visual Designer, you get different Properties windows.
When this composite component is selected in the Visual Designer, you see it in the Outline window, and you can
see which part of the component you have selected. The componentLabel
is
the main node of the component, and the componentLabelText
is
a subnode. You can also use the Outline window to select
either part of the component and work with the selected
component part's properties.
- Select the component drag it to another location on the
page.
- Select the outer component and edit its properties in the
Component Label property
sheet. Some typical properties you might set are:
- id. The name of the Component Label. In the JSP
file, this name is the value of the id attribute.
In the page bean, this property's value is the name of
the HtmlOutputLabel object.
- for. The component for which this Component Label
component provides a label.
- Select the inner part of the component, the componentLabelText
,
and edit its properties in the Output Text property
sheet. The most useful thing you can do in the property
sheet is to set the visible label text for the component in
the Output Text component's value property. You can also bind
the Output Text component to a table and set the label's text
dynamically.
- See Also
- Working
With Components
- Component
Tasks: Quick Reference
- Component
Web Tutorials
- Data
Source Web Tutorials
- About the Palette