Class ResolveComponent

All Implemented Interfaces:
PartialStateHolder, StateHolder, TransientStateHolder, ComponentSystemEventListener, FacesListener, SystemEventListener, SystemEventListenerHolder, EventListener, FaceletContextConsumer

public class ResolveComponent extends UtilFamily implements FaceletContextConsumer, SystemEventListener

The <o:resolveComponent> component is a utility component via which a component can be looked up by its ID and a reference to it put in either the "facelet scope" (default) or the request scope.

Since:
2.0
Author:
Arjan Tijms
See Also:
  • Field Details

    • COMPONENT_TYPE

      public static final String COMPONENT_TYPE
      The component type, which is "org.omnifaces.component.util.ResolveComponent".
      See Also:
    • DEFAULT_SCOPE

      public static final String DEFAULT_SCOPE
      The default scope, which is "facelet".
      See Also:
  • Constructor Details

    • ResolveComponent

      public ResolveComponent()
      Constructs the component.
  • Method Details

    • setFaceletContext

      public void setFaceletContext(FaceletContext faceletContext)
      Description copied from interface: FaceletContextConsumer
      Sets the Facelet context.
      Specified by:
      setFaceletContext in interface FaceletContextConsumer
      Parameters:
      faceletContext - The involved Facelet context.
    • isListenerForSource

      public boolean isListenerForSource(Object source)
      Specified by:
      isListenerForSource in interface SystemEventListener
    • processEvent

      public void processEvent(SystemEvent event)
      Specified by:
      processEvent in interface SystemEventListener
    • processEvent

      public void processEvent(ComponentSystemEvent event)
      Specified by:
      processEvent in interface ComponentSystemEventListener
      Overrides:
      processEvent in class UIComponent
    • getName

      public String getName()
      Returns name under which the component will be made available to EL.
      Returns:
      Name under which the component will be made available to EL.
    • setName

      public void setName(String nameValue)
      Sets name under which the component will be made available to EL, scoped to the body of the Facelets tag (default) or to the request.
      Parameters:
      nameValue - Name under which the component will be made available to EL.
    • getFor

      public String getFor()
      Returns ID of the component that will be resolved (looked-up) and if found a reference of it made available to EL.
      Returns:
      ID of the component that will be resolved (looked-up) and if found a reference of it made available to EL.
    • setFor

      public void setFor(String forValue)
      Sets ID of the component that will be resolved (looked-up) and if found a reference of it made available to EL.
      Parameters:
      forValue - ID of the component that will be resolved (looked-up) and if found a reference of it made available to EL.
    • getScope

      public String getScope()
      Returns optional scope identifier used to set the scope in which the component reference is inserted. Default is facelet.
      Returns:
      Optional scope identifier used to set the scope in which the component reference is inserted.
    • setScope

      public void setScope(String scopeValue)
      Optional scope identifier used to set the scope in which the component reference is inserted. If no scope is specified, the default scope "facelet" will be used.

      Values values are "facelet" (default) and "request".

      Parameters:
      scopeValue - Optional scope identifier used to set the scope in which the component reference is inserted.