HTML and CSS Reference
In-Depth Information
Figure 4-5.
The main classes in the JSF event object hierarchy
In order to define JSF event objects, all of the JSF event objects extend
EventObject
class. There are three
important things to notice:
•
FacesEvent
is the base class for events that can be triggered by
UIComponent
s. It has two
subclasses:
ActionEvent
class, which represents events that are triggered by
ActionSource2
components, and
ValueChangeEvent
class, which represents events that are triggered by
ValueHolder
or
EditableValueHolder
components.
•
SystemEvent
is the base class for all the System events.
ComponentSystemEvent
class
(extends
SystemEvent)
represents System events which are specific for
UIComponent
s.
•
PhaseEvent
is a class that represents Phase events which occur in the beginning and ending of
each standard phase of the JSF request processing lifecycle.
■
It is important to know that all of the JSF event listener interfaces and event classes are located in
(
javax.faces.event
) package. during the chapter and for simplicity, we will mention only the event listener interface
name or the event class name without mentioning the fully qualified interface (or class) name.
Note
Faces Events
Faces events are those events which can be triggered by
UIComponent
s. Faces events include two types of events:
•
Action Events.
•
Action events are fired by
ActionSource2
components such as (
CommandButton
or
CommandLink
components).
An action event is fired when, for example,
UICommand
component is clicked. Value change events are fired by
ValueHolder
components such as (
outputText
component) or
EditableValueHolder
components such as
(
inputText
or
selectOneMenu
components). A value change event is fired when the component's value is changed.
Before going to the examples of both types of events, it is important to know when each of these events fire in the
phases of the JSF life cycle. Figure
4-6
shows the execution time of both action and value change events.
Value Change Events.
