Top Description Fields Constructors Methods
jakarta.faces.event

public abstract Class FacesEvent

extends EventObject
Class Inheritance
Known Direct Subclasses
jakarta.faces.event.ValueChangeEvent, com.sun.faces.facelets.component.UIRepeat.IndexedEvent, jakarta.faces.component.WrapperEvent, jakarta.faces.event.ActionEvent, jakarta.faces.event.BehaviorEvent
Imports
java.util.EventObject, jakarta.faces.component.UIComponent, .UIViewAction, .UIViewRoot, jakarta.faces.context.FacesContext

FacesEvent is the base class for user interface and application events that can be fired by UIComponents. Concrete event classes must subclass FacesEvent in order to be supported by the request processing lifecycle.

Field Summary

Modifier and TypeField and Description
private transient FacesContext
facesContext

Stores the Faces context.

private PhaseId
private static final long
Inherited from java.util.EventObject:
source

Constructor Summary

AccessConstructor and Description
public
FacesEvent(UIComponent
Source UIComponent for this event
component
)

Construct a new event object from the specified source component.

public
FacesEvent(FacesContext
the Faces context.
facesContext
,
UIComponent
Source UIComponent for this event.
component
)

Construct a new event object from the Faces context and specified source component.

Method Summary

Modifier and TypeMethod and Description
public UIComponent

Returns:

the source UI component.
getComponent
()

Return the source UIComponent that sent this event.

public FacesContext

Returns:

the Faces context.
getFacesContext
()

Get the Faces context.

public PhaseId

Returns:

the phase id.
getPhaseId
()

Return the identifier of the request processing phase during which this event should be delivered.

public abstract boolean

Returns:

true if it is the appropriate instance, false otherwise.
isAppropriateListener
(FacesListener
FacesListener to evaluate
listener
)

Return true if this FacesListener is an instance of a listener class that this event supports.

public abstract void
processListener(FacesListener
FacesListener to send this FacesEvent to
listener
)

Broadcast this FacesEvent to the specified FacesListener, by whatever mechanism is appropriate.

public void
queue()

Convenience method to queue this event for broadcast at the end of the current request processing lifecycle phase.

public void
setPhaseId(PhaseId
the phase id.
phaseId
)

Set the PhaseId during which this event will be delivered.

Inherited from java.util.EventObject:
getSourcetoString

Field Detail

facesContextback to summary
private transient FacesContext facesContext

Stores the Faces context.

phaseIdback to summary
private PhaseId phaseId
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.EventObject.serialVersionUID.

Constructor Detail

FacesEventback to summary
public FacesEvent(UIComponent component)

Construct a new event object from the specified source component.

Parameters
component:UIComponent

Source UIComponent for this event

Exceptions
IllegalArgumentException:
if component is null
FacesEventback to summary
public FacesEvent(FacesContext facesContext, UIComponent component)

Construct a new event object from the Faces context and specified source component.

Parameters
facesContext:FacesContext

the Faces context.

component:UIComponent

Source UIComponent for this event.

Exceptions
IllegalArgumentException:
if component is null
Since
2.3

Method Detail

getComponentback to summary
public UIComponent getComponent()

Return the source UIComponent that sent this event.

Returns:UIComponent

the source UI component.

getFacesContextback to summary
public FacesContext getFacesContext()

Get the Faces context.

If the constructor was passed a FacesContext we return it, otherwise we call FacesContext.getCurrentInstance() and return it.

Returns:FacesContext

the Faces context.

Since
2.3
getPhaseIdback to summary
public PhaseId getPhaseId()

Return the identifier of the request processing phase during which this event should be delivered. Legal values are the singleton instances defined by the PhaseId class, including PhaseId.ANY_PHASE, which is the default value.

Returns:PhaseId

the phase id.

isAppropriateListenerback to summary
public abstract boolean isAppropriateListener(FacesListener listener)

Return true if this FacesListener is an instance of a listener class that this event supports. Typically, this will be accomplished by an "instanceof" check on the listener class.

Parameters
listener:FacesListener

FacesListener to evaluate

Returns:boolean

true if it is the appropriate instance, false otherwise.

processListenerback to summary
public abstract void processListener(FacesListener listener)

Broadcast this FacesEvent to the specified FacesListener, by whatever mechanism is appropriate. Typically, this will be accomplished by calling an event processing method, and passing this FacesEvent as a paramter.

Parameters
listener:FacesListener

FacesListener to send this FacesEvent to

Exceptions
AbortProcessingException:
Signal the Jakarta Faces implementation that no further processing on the current event should be performed
queueback to summary
public void queue()

Convenience method to queue this event for broadcast at the end of the current request processing lifecycle phase.

Exceptions
IllegalStateException:
if the source component for this event is not a descendant of a UIViewRoot
setPhaseIdback to summary
public void setPhaseId(PhaseId phaseId)

Set the PhaseId during which this event will be delivered.

Parameters
phaseId:PhaseId

the phase id.

Exceptions
IllegalArgumentException:
phaseId is null.