public class ValueChangeEvent extends FacesEvent
A ValueChangeEvent
is a notification
that the local value of the source component has been change as a result of
user interface activity. It is not fired unless validation of the new value
was completed successfully.
Constructor and Description |
---|
ValueChangeEvent(FacesContext facesContext,
UIComponent component,
java.lang.Object oldValue,
java.lang.Object newValue)
Construct a new event object from the Faces context, specified source component, old value and new value. |
ValueChangeEvent(UIComponent component,
java.lang.Object oldValue,
java.lang.Object newValue)
Construct a new event object from the specified source component, old value, and new value. |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getNewValue()
Return the current local value of the source
UIComponent . |
java.lang.Object |
getOldValue()
Return the previous local value of the source
UIComponent . |
boolean |
isAppropriateListener(FacesListener listener)
Return
true if this FacesListener is an instance
of a listener class that this event supports. |
void |
processListener(FacesListener listener)
Broadcast this
FacesEvent to the specified
FacesListener , by whatever mechanism is appropriate. |
getComponent, getFacesContext, getPhaseId, queue, setPhaseId
public ValueChangeEvent(UIComponent component, java.lang.Object oldValue, java.lang.Object newValue)
Construct a new event object from the specified source component, old value, and new value.
The default PhaseId
for this event is PhaseId.ANY_PHASE
.
component
- Source UIComponent
for this eventoldValue
- The previous local value of this UIComponent
newValue
- The new local value of thie UIComponent
java.lang.IllegalArgumentException
- if component
is
null
public ValueChangeEvent(FacesContext facesContext, UIComponent component, java.lang.Object oldValue, java.lang.Object newValue)
Construct a new event object from the Faces context, specified source component, old value and new value.
The default PhaseId
for this event is PhaseId.ANY_PHASE
.
facesContext
- the Faces context.component
- Source UIComponent
for this eventoldValue
- The previous local value of this UIComponent
newValue
- The new local value of thie UIComponent
java.lang.IllegalArgumentException
- if component
is
null
public java.lang.Object getOldValue()
Return the previous local value of the source UIComponent
.
public java.lang.Object getNewValue()
Return the current local value of the source UIComponent
.
public boolean isAppropriateListener(FacesListener listener)
FacesEvent
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.
isAppropriateListener
in class FacesEvent
listener
- FacesListener
to evaluatepublic void processListener(FacesListener listener)
FacesEvent
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.
processListener
in class FacesEvent
listener
- FacesListener
to send this FacesEvent
toAbortProcessingException
- Signal the Jakarta Server Faces
implementation that no further processing on the current event
should be performed