javax.faces.component

Class UIViewRoot

Parameters:
create - true to create a new Map for this instance if necessary; false to return null if there's no current Map.
Since:
2.0
  • subscribeToViewEvent

    public void subscribeToViewEvent(Class<? extends SystemEvent> systemEvent,
                                     SystemEventListener listener)

    Install the listener instance referenced by argument listener into the UIViewRoot as a listener for events of type systemEventClass.

    Note that installed listeners are not maintained as part of the UIViewRoot's state.

    Parameters:
    systemEvent - the Class of event for which listener must be fired.
    listener - the implementation of SystemEventListener whose SystemEventListener.processEvent(javax.faces.event.SystemEvent) method must be called when events of type systemEventClass are fired.
    Throws:
    NullPointerException - if systemEventClass or listener are null.
    Since:
    2.0
  • unsubscribeFromViewEvent

    public void unsubscribeFromViewEvent(Class<? extends SystemEvent> systemEvent,
                                         SystemEventListener listener)

    Remove the listener instance referenced by argument listener from the UIViewRoot as a listener for events of type systemEventClass.

    Parameters:
    systemEvent - the Class of event for which listener must be fired.
    listener - the implementation of SystemEventListener whose SystemEventListener.processEvent(javax.faces.event.SystemEvent) method must be called when events of type systemEventClass are fired.
    Throws:
    NullPointerException - if systemEventClass or listener are null.
    Since:
    2.0
  • getViewListenersForEventClass

    public List<SystemEventListener> getViewListenersForEventClass(Class<? extends SystemEvent> systemEvent)

    Return the SystemEventListener instances registered on this UIComponent instance that are interested in events of type eventClass.

    Parameters:
    systemEvent - the Class of event for which the listeners must be returned.
    Throws:
    NullPointerException - if argument systemEvent is null.
    Since:
    2.0
  • restoreViewScopeState

    public void restoreViewScopeState(FacesContext context,
                                      Object state)

    Restore ViewScope state. This is needed to allow the use of view scoped beans for EL-expressions in the template from which the component tree is built. For example: <ui:include src="https://www.gaudry.be/java-api-javaee/#{viewScopedBean.includeFileName}"/>.

    Parameters:
    context - current FacesContext.
    state - the state object.
  • saveState

    public Object saveState(FacesContext context)
    Description copied from interface: StateHolder

    Gets the state of the instance as a Serializable Object.

    If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

    This method must not alter the state of the implementing object. In other words, after executing this code:

     Object state = component.saveState(facesContext);
     

    component should be the same as before executing it.

    The return from this method must be Serializable

    Specified by:
    saveState in interface StateHolder
    Overrides:
    saveState in class UIComponentBase