Class ImportTemplate
java.lang.Object
javax.faces.component.UIComponent
javax.faces.component.UIComponentBase
javax.faces.component.UINamingContainer
com.webmethods.caf.faces.component.logic.ImportTemplate
- All Implemented Interfaces:
IDynamicComponent
,IPostPageComponentPhaseListener
,IScopedVariableComponent
,Serializable
,EventListener
,NamingContainer
,PartialStateHolder
,StateHolder
,TransientStateHolder
,UniqueIdVendor
,ComponentSystemEventListener
,FacesListener
,PhaseListener
,SystemEventListenerHolder
public class ImportTemplate
extends UINamingContainer
implements PhaseListener, IPostPageComponentPhaseListener, IScopedVariableComponent, IDynamicComponent
Imports view tree from some other .view file in the current webapp (or classpath)
into the current view tree.
To specify a view on the classpath, prefix the import value with "classpath:".
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Integer
static final String
protected static final String
protected static final String
Fields inherited from class javax.faces.component.UINamingContainer
COMPONENT_FAMILY, COMPONENT_TYPE, SEPARATOR_CHAR_PARAM_NAME
Fields inherited from class javax.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
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterPhase
(PhaseEvent event) void
beforePhase
(PhaseEvent event) protected void
clearComponentBeans
(UIComponent component) void
encodeBegin
(FacesContext context) void
encodeChildren
(FacesContext context) void
encodeEnd
(FacesContext context) int
protected static ImportTemplate
getImportContainer
(FacesContext context, UIComponent component) Finds the import control containing the specified component.protected Object
protected String
Deprecated.protected String
boolean
Gets the scoped variable objectGet the name of the scoped variablegetValue()
Return a reference to the page bean backing this instance, for use cases where the bean needs to be referenced outside the context of the Import control.protected void
protected void
importView
(String viewId) Imports the contents of the specified view as children of this control.void
Perform the initial programmatic manipulation of the component tree.void
postPageAfterPhase
(PhaseEvent event) void
postPageBeforePhase
(PhaseEvent event) void
processDecodes
(FacesContext context) void
processEvent
(ComponentSystemEvent event) void
processRestoreState
(FacesContext context, Object state) processSaveState
(FacesContext context) void
processUpdates
(FacesContext context) void
processValidators
(FacesContext context) protected void
propagateParametersToPageBean
(BaseViewBean pageBean) Propagates non-content param values from this control to the appropriate properties of the specified page bean.protected void
If the viewId does not match what was previously loaded, reload the imported viewvoid
restoreState
(FacesContext context, Object state) saveState
(FacesContext context) void
boolean
visitTree
(VisitContext context, VisitCallback callback) Methods inherited from class javax.faces.component.UINamingContainer
createUniqueId, getFamily, getSeparatorChar
Methods inherited from class javax.faces.component.UIComponentBase
addClientBehavior, addFacesListener, broadcast, clearInitialState, decode, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacesContext, getFacesListeners, getFacet, getFacets, getId, getListenersForEventClass, getParent, getPassThroughAttributes, getRenderer, getRendererType, getValueBinding, invokeOnComponent, isRendered, isTransient, markInitialState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding, subscribeToEvent, unsubscribeFromEvent
Methods inherited from class javax.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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.faces.component.StateHolder
isTransient, setTransient
-
Field Details
-
VIEW_LOADED
- See Also:
-
VIEW_CHECKED_FORM_NESTING
- See Also:
-
PARAM_ID_PREFIX
- See Also:
-
fInstanceNumber
-
-
Constructor Details
-
ImportTemplate
public ImportTemplate()
-
-
Method Details
-
restoreState
- Specified by:
restoreState
in interfaceStateHolder
- Overrides:
restoreState
in classUIComponentBase
-
saveState
- Specified by:
saveState
in interfaceStateHolder
- Overrides:
saveState
in classUIComponentBase
-
afterPhase
- Specified by:
afterPhase
in interfacePhaseListener
-
beforePhase
- Specified by:
beforePhase
in interfacePhaseListener
-
reloadViewIfChanged
protected void reloadViewIfChanged()If the viewId does not match what was previously loaded, reload the imported view -
getPhaseId
- Specified by:
getPhaseId
in interfacePhaseListener
-
postPageBeforePhase
- Specified by:
postPageBeforePhase
in interfaceIPostPageComponentPhaseListener
-
postPageAfterPhase
- Specified by:
postPageAfterPhase
in interfaceIPostPageComponentPhaseListener
-
getPostPagePhaseId
- Specified by:
getPostPagePhaseId
in interfaceIPostPageComponentPhaseListener
-
getImportContainer
Finds the import control containing the specified component.- Parameters:
context
- Current context.component
- Component whose import control to find.- Returns:
- Import control or null.
-
importView
Imports the contents of the specified view as children of this control. -
clearComponentBeans
-
propagateParametersToPageBean
Propagates non-content param values from this control to the appropriate properties of the specified page bean. -
getValue
-
setValue
-
getViewPageBean
Return a reference to the page bean backing this instance, for use cases where the bean needs to be referenced outside the context of the Import control.- Returns:
- backing bean for the imported view. May be null.
-
getInternalPageBean
-
getInternalPageBeanName
Deprecated.UsegetPageBeanName()
instead- Returns:
-
getPageBeanName
-
getRendersChildren
public boolean getRendersChildren()- Overrides:
getRendersChildren
in classUIComponentBase
-
encodeBegin
- Overrides:
encodeBegin
in classUIComponentBase
- Throws:
IOException
-
encodeChildren
- Overrides:
encodeChildren
in classUIComponentBase
- Throws:
IOException
-
encodeEnd
- Overrides:
encodeEnd
in classUIComponentBase
- Throws:
IOException
-
processDecodes
- Overrides:
processDecodes
in classUIComponentBase
-
processRestoreState
- Overrides:
processRestoreState
in classUIComponentBase
-
processSaveState
- Overrides:
processSaveState
in classUIComponentBase
-
processUpdates
- Overrides:
processUpdates
in classUIComponentBase
-
processValidators
- Overrides:
processValidators
in classUIComponentBase
-
visitTree
- Overrides:
visitTree
in classUINamingContainer
-
getScopedVariableName
Description copied from interface:IScopedVariableComponent
Get the name of the scoped variable- Specified by:
getScopedVariableName
in interfaceIScopedVariableComponent
- Returns:
-
getScopedVariable
Description copied from interface:IScopedVariableComponent
Gets the scoped variable object- Specified by:
getScopedVariable
in interfaceIScopedVariableComponent
- Returns:
- variable object
-
processEvent
- Specified by:
processEvent
in interfaceComponentSystemEventListener
- Overrides:
processEvent
in classUIComponent
- Throws:
AbortProcessingException
-
handleNestedForms
protected void handleNestedForms() -
populateInitialComponents
public void populateInitialComponents()Description copied from interface:IDynamicComponent
Perform the initial programmatic manipulation of the component tree.- Specified by:
populateInitialComponents
in interfaceIDynamicComponent
-
getFacetCount
public int getFacetCount()- Overrides:
getFacetCount
in classUIComponentBase
-
getFacetsAndChildren
- Overrides:
getFacetsAndChildren
in classUIComponentBase
-