background image

Component Rendering Model

<< User Interface Component Classes | The Render Kit >>
<< User Interface Component Classes | The Render Kit >>

Component Rendering Model

These behavioral interfaces are as follows:
ActionSource
: Indicates that the component can fire an action event. This interface is
intended for use with components based on JavaServer Faces technology 1.1_01 and earlier
versions.
ActionSource2
: Extends ActionSource, and therefore provides the same functionality.
However, it allows components to use the unified EL when referencing methods that handle
action events.
EditableValueHolder
: Extends ValueHolder and specifies additional features for editable
components, such as validation and emitting value-change events.
NamingContainer
: Mandates that each component rooted at this component have a unique
ID.
StateHolder
: Denotes that a component has state that must be saved between requests.
ValueHolder
: Indicates that the component maintains a local value as well as the option of
accessing data in the model tier.
UICommand
implements ActionSource2 and StateHolder. UIOutput and component classes
that extend UIOutput implement StateHolder and ValueHolder. UIInput and component
classes that extend UIInput implement EditableValueHolder, StateHolder, and
ValueHolder
. UIComponentBase implements StateHolder. See the
JavaServer Faces
Technology 1.2 API Specification
for more information on these interfaces.
Only component writers will need to use the component classes and behavioral interfaces
directly. Page authors and application developers will use a standard UI component by
including a tag that represents it on a JSP page. Most of the components can be rendered in
different ways on a page. For example, a UICommand component can be rendered as a button or a
hyperlink.
The next section explains how the rendering model works and how page authors choose how to
render the components by selecting the appropriate tags.
Component Rendering Model
The JavaServer Faces component architecture is designed such that the functionality of the
components is defined by the component classes, whereas the component rendering can be
defined by a separate renderer. This design has several benefits, including:
Component writers can define the behavior of a component once but create multiple
renderers, each of which defines a different way to render the component to the same client
or to different clients.
Page authors and application developers can change the appearance of a component on the
page by selecting the tag that represents the appropriate combination of component and
renderer.
User Interface Component Model
Chapter 10 · JavaServer Faces Technology
301