Java Reference
In-Depth Information
You identify the type associated with the renderer in the
rendererType
element of
the
@FacesRenderer
annotation for
AreaRenderer
as well as in the
renderer-
type
element of the tag library descriptor file.
Implementing an Event Listener
The JavaServer Faces technology supports action events and value-change events for
components.
Action events occur when the user activates a component that implements
javax.faces.component.ActionSource
. These events are represented by the
class
javax.faces.event.ActionEvent
.
Value-change events occur when the user changes the value of a component that im-
plements
javax.faces.component.EditableValueHolder
. These events are
represented by the class
javax.faces.event.ValueChangeEvent
.
One way to handle events is to implement the appropriate listener classes. Listener
classes that handle the action events in an application must implement the interface
javax.faces.event.ActionListener
. Similarly, listeners that handle the value-
change
events
must
implement
the
interface
javax.faces.event.ValueChangeListener
.
This section explains how to implement the two listener classes.
To handle events generated by custom components, you must implement an event listener
and an event handler and manually queue the event on the component. See “
Handling
Events for Custom Components
”
on page
119
for more information.
Note
You do not need to create an
ActionListener
implementation to
handle an event that results solely in navigating to a page and does
not perform any other application-specific processing. See “Writing a
Method to Handle Navigation” in
The Java EE 6 Tutorial: Basic Con-
cepts
for information on how to manage page navigation.
Implementing Value-Change Listeners
A
javax.faces.event.ValueChangeListener
implementation must include a
processValueChange(ValueChangeEvent)
method. This method processes the
specified value-change event and is invoked by the JavaServer Faces implementation