Class Events


  • public final class Events
    extends Object

    Collection of utility methods for the Faces API with respect to working with system and phase events.

    Usage

    Some examples:

     // Add a callback to the current view which should run during every after phase of the render response on same view.
     Events.subscribeToViewAfterPhase(PhaseId.RENDER_RESPONSE, () -> {
         // ...
     });
     
     // Add a callback to the current request which should run during before phase of the render response on current request.
     Events.subscribeToRequestBeforePhase(PhaseId.RENDER_RESPONSE, () -> {
         // ...
     });
     
     // Add a callback to the current view which should run during the pre render view event.
     Events.subscribeToViewEvent(PreRenderViewEvent.class, () -> {
         // ...
     });
     

    Note that you can specify any phase ID or system event to your choice.

    Author:
    Arjan Tijms, Bauke Scholtz
    See Also:
    CallbackPhaseListener