background image

UI Component Tag Attributes

<< The jsf_core Tags | The immediate Attribute >>
<< The jsf_core Tags | The immediate Attribute >>

UI Component Tag Attributes

Adding UI Components to a Page Using the HTML Component
Tags
The tags defined by the JavaServer Faces standard HTML render kit tag library represent HTML
form components and other basic HTML elements. These components display data or accept
data from the user. This data is collected as part of a form and is submitted to the server, usually
when the user clicks a button. This section explains how to use each of the component tags
shown in
Table 10­2
.
The next section explains the more important tag attributes that are common to most
component tags. Please refer to the TLD documentation at
http://java.sun.com/javaee/javaserverfaces/1.2/docs/tlddocs/index.html
for a
complete list of tags and their attributes.
For each of the components discussed in the following sections,
"Writing Bean Properties" on
page 379
explains how to write a bean property bound to a particular UI component or its value.
UI Component Tag Attributes
In general, most of the component tags support these attributes:
id
: Uniquely identifies the component.
immediate
: If set to true, indicates that any events, validation, and conversion associated
with the component should happen in the apply request values phase rather than a later
phase.
rendered
: Specifies a condition in which the component should be rendered. If the
condition is not satisfied, the component is not rendered.
style
: Specifies a Cascading Style Sheet (CSS) style for the tag.
styleClass
: Specifies a CSS stylesheet class that contains definitions of the styles.
value
: Identifies an external data source and binds the component's value to it.
binding
: Identifies a bean property and binds the component instance to it.
All of the UI component tag attributes (except id) can accept expressions, as defined by the
unified EL described in
"Unified Expression Language" on page 146
.
The id Attribute
The id attribute is not required for a component tag except in the case when another
component or a server-side class must refer to the component. If you don't include an id
attribute, the JavaServer Faces implementation automatically generates a component ID. Unlike
most other JavaServer Faces tag attributes, the id attribute only takes expressions using the
immediate evaluation syntax, which uses the ${} delimiters.
Adding UI Components to a Page Using the HTML Component Tags
Chapter 11 · Using JavaServer Faces Technology in JSP Pages
327