Package org.omnifaces.component.util
Class ResolveComponent
- java.lang.Object
-
- jakarta.faces.component.UIComponent
-
- jakarta.faces.component.UIComponentBase
-
- org.omnifaces.component.util.UtilFamily
-
- org.omnifaces.component.util.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:
FaceletContextConsumer
,ComponentExtraHandler
,UtilFamily
-
-
Field Summary
Fields Modifier and Type Field Description static String
COMPONENT_TYPE
The component type, which is "org.omnifaces.component.util.ResolveComponent".static String
DEFAULT_SCOPE
The default scope, which is "facelet".-
Fields inherited from class org.omnifaces.component.util.UtilFamily
COMPONENT_FAMILY
-
Fields inherited from class jakarta.faces.component.UIComponent
ATTRS_WITH_DECLARED_DEFAULT_VALUES, BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, CURRENT_COMPONENT, CURRENT_COMPOSITE_COMPONENT, FACETS_KEY, HONOR_CURRENT_COMPONENT_ATTRIBUTES_PARAM_NAME, VIEW_LOCATION_KEY
-
-
Constructor Summary
Constructors Constructor Description ResolveComponent()
Constructs the component.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getFor()
Returns ID of the component that will be resolved (looked-up) and if found a reference of it made available to EL.String
getName()
Returns name under which the component will be made available to EL.String
getScope()
Returns optional scope identifier used to set the scope in which the component reference is inserted.boolean
isListenerForSource(Object source)
void
processEvent(ComponentSystemEvent event)
void
processEvent(SystemEvent event)
void
setFaceletContext(FaceletContext faceletContext)
Sets the Facelet context.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.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.void
setScope(String scopeValue)
Optional scope identifier used to set the scope in which the component reference is inserted.-
Methods inherited from class org.omnifaces.component.util.UtilFamily
getFamily, getRendersChildren
-
Methods inherited from class jakarta.faces.component.UIComponentBase
addClientBehavior, addFacesListener, broadcast, clearInitialState, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getListenersForEventClass, getParent, getPassThroughAttributes, getRenderer, getRendererType, getValueBinding, invokeOnComponent, isRendered, isTransient, markInitialState, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, restoreState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding, subscribeToEvent, unsubscribeFromEvent
-
Methods inherited from class jakarta.faces.component.UIComponent
encodeAll, getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getNamingContainer, getPassThroughAttributes, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, pushComponentToEL, restoreTransientState, saveTransientState, setInView, setValueExpression, visitTree
-
-
-
-
Field Detail
-
COMPONENT_TYPE
public static final String COMPONENT_TYPE
The component type, which is "org.omnifaces.component.util.ResolveComponent".- See Also:
- Constant Field Values
-
DEFAULT_SCOPE
public static final String DEFAULT_SCOPE
The default scope, which is "facelet".- See Also:
- Constant Field Values
-
-
Method Detail
-
setFaceletContext
public void setFaceletContext(FaceletContext faceletContext)
Description copied from interface:FaceletContextConsumer
Sets the Facelet context.- Specified by:
setFaceletContext
in interfaceFaceletContextConsumer
- Parameters:
faceletContext
- The involved Facelet context.
-
isListenerForSource
public boolean isListenerForSource(Object source)
- Specified by:
isListenerForSource
in interfaceSystemEventListener
-
processEvent
public void processEvent(SystemEvent event)
- Specified by:
processEvent
in interfaceSystemEventListener
-
processEvent
public void processEvent(ComponentSystemEvent event)
- Specified by:
processEvent
in interfaceComponentSystemEventListener
- Overrides:
processEvent
in classUIComponent
-
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 isfacelet
.- 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.
-
-