public class CallbackPhaseListener extends Object implements PhaseListener
addCallbackXxx()
methods
of the Events
utility class and calls them back for each matching phase.
This differs in a few subtle ways from Events.addPhaseListener(PhaseListener)
. Namely, the phase listener
registered here will be called via the global phase listener, which executes slightly earlier for its before phase
and slightly later for its after phase as compared to phase listeners attached to the view root.
Additionally, a phase listener registered via this method will not become part of the view state, but will execute only once. Phase listeners attached to the view root will come back after each postback and have to be removed manually (in Mojarra this can be difficult due to the fact iterators over listeners are kept 'open' during each phase).
Events.addCallbackPhaseListener(PhaseListener)
,
Events.addCallbackBeforePhaseListener(PhaseId, org.omnifaces.util.Callback.Void)
,
Events.addCallbackAfterPhaseListener(PhaseId, org.omnifaces.util.Callback.Void)
,
Serialized FormConstructor and Description |
---|
CallbackPhaseListener() |
Modifier and Type | Method and Description |
---|---|
static void |
add(PhaseListener phaseListener) |
void |
afterPhase(PhaseEvent event) |
void |
beforePhase(PhaseEvent event) |
PhaseId |
getPhaseId() |
static boolean |
remove(PhaseListener phaseListener) |
public PhaseId getPhaseId()
getPhaseId
in interface PhaseListener
public void beforePhase(PhaseEvent event)
beforePhase
in interface PhaseListener
public void afterPhase(PhaseEvent event)
afterPhase
in interface PhaseListener
public static void add(PhaseListener phaseListener)
public static boolean remove(PhaseListener phaseListener)