public class InvokeActionEventListener extends DefaultPhaseListener implements SystemEventListener
PreInvokeActionEvent
and PostInvokeActionEvent
events are
properly published.
This phase listener is already registered by OmniFaces' own faces-config.xml and thus gets auto-initialized when the OmniFaces JAR is bundled in a webapp, so end-users do not need to register this phase listener explicitly themselves.
PreInvokeActionEvent
,
PostInvokeActionEvent
,
Serialized FormConstructor and Description |
---|
InvokeActionEventListener()
This constructor instructs the
DefaultPhaseListener to hook on PhaseId.INVOKE_APPLICATION and
subscribes this instance as a SystemEventListener to the PostValidateEvent event. |
Modifier and Type | Method and Description |
---|---|
void |
afterPhase(PhaseEvent event)
Publish the
PostInvokeActionEvent event on the components which are been collected in
processEvent(SystemEvent) . |
void |
beforePhase(PhaseEvent event)
Publish the
PreInvokeActionEvent event on the components which are been collected in
processEvent(SystemEvent) . |
boolean |
isListenerForSource(Object source)
|
void |
processEvent(SystemEvent event)
If the validation has not failed for the current faces context, then check if the
UIComponent which
passed the isListenerForSource(Object) check has any listeners for the PreInvokeActionEvent
and/or PostInvokeActionEvent events and then add them to a set in the current faces context. |
getPhaseId
public InvokeActionEventListener()
DefaultPhaseListener
to hook on PhaseId.INVOKE_APPLICATION
and
subscribes this instance as a SystemEventListener
to the PostValidateEvent
event. This allows
collecting the components eligible for PreInvokeActionEvent
or PostInvokeActionEvent
inside the
processEvent(SystemEvent)
method.public boolean isListenerForSource(Object source)
isListenerForSource
in interface SystemEventListener
public void processEvent(SystemEvent event) throws AbortProcessingException
UIComponent
which
passed the isListenerForSource(Object)
check has any listeners for the PreInvokeActionEvent
and/or PostInvokeActionEvent
events and then add them to a set in the current faces context.processEvent
in interface SystemEventListener
AbortProcessingException
public void beforePhase(PhaseEvent event)
PreInvokeActionEvent
event on the components which are been collected in
processEvent(SystemEvent)
.beforePhase
in interface PhaseListener
beforePhase
in class DefaultPhaseListener
public void afterPhase(PhaseEvent event)
PostInvokeActionEvent
event on the components which are been collected in
processEvent(SystemEvent)
.afterPhase
in interface PhaseListener
afterPhase
in class DefaultPhaseListener