- All Implemented Interfaces:
- NamingContainer,- PartialStateHolder,- StateHolder,- TransientStateHolder,- UniqueIdVendor,- ComponentSystemEventListener,- FacesListener,- SystemEventListenerHolder,- EventListener
- 
Field SummaryFieldsFields inherited from class jakarta.faces.component.UINamingContainerSEPARATOR_CHAR_PARAM_NAMEFields inherited from class jakarta.faces.component.UIComponentATTRS_WITH_DECLARED_DEFAULT_VALUES, BEANINFO_KEY, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, FACETS_KEY, VIEW_LOCATION_KEYFields inherited from interface jakarta.faces.component.NamingContainerSEPARATOR_CHAR
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidbroadcast(FacesEvent event) Broadcast the specifiedFacesEventto all registered event listeners who have expressed an interest in events of this type.voidencodeChildren(FacesContext faces) getBegin()getClientId(FacesContext faces) Return a client-side identifier for this component, generating one if necessary.getEnd()Return the identifier of the component family to which this component belongs.booleanReturn a flag indicating whether this component is responsible for rendering its child components.getSize()getStep()getValue()getVar()booleaninvokeOnComponent(FacesContext faces, String clientId, ContextCallback callback) Starting at this component in the View hierarchy, search for a component with aclientIdequal to the argumentclientIdand, if found, call theContextCallback.invokeContextCallback(jakarta.faces.context.FacesContext, jakarta.faces.component.UIComponent)method on the argumentcallback, passing the currentFacesContextand the found component as arguments.booleanReturns whether row state is preserved as persetRowStatePreserved(boolean).voidOverride the base class method to take special action if the method is being invoked whenStateManager.IS_BUILDING_INITIAL_STATEis true and therowStatePreservedproperty for this instance istrue.voidprocess(FacesContext faces, PhaseId phase) voidprocessDecodes(FacesContext faces) Perform the component tree processing required by the Apply Request Values phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.voidprocessUpdates(FacesContext faces) Perform the component tree processing required by the Update Model Values phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.voidprocessValidators(FacesContext faces) Perform the component tree processing required by the Process Validations phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.voidqueueEvent(FacesEvent event) Queue an event for broadcast at the end of the current request processing lifecycle phase.voidrestoreState(FacesContext faces, Object object) Perform any processing required to restore the state from the entries in the state Object.saveState(FacesContext faces) Gets the state of the instance as aSerializableObject.voidvoidvoidvoidsetRowStatePreserved(boolean rowStatePreserved) Boolean flag directing how the per-row component state ofEditableValueHolderchildren should be handled across requests on the same view.voidvoidvoidvoidvoidsetVarStatus(String varStatus) booleanvisitTree(VisitContext context, VisitCallback callback) Perform a tree visit starting at this node in the tree.Methods inherited from class jakarta.faces.component.UINamingContainercreateUniqueId, getSeparatorCharMethods inherited from class jakarta.faces.component.UIComponentBaseaddClientBehavior, addFacesListener, clearInitialState, decode, encodeBegin, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getDefaultEventName, getEventNames, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getListenersForEventClass, getParent, getPassThroughAttributes, getRenderer, getRendererType, isRendered, isTransient, processRestoreState, processSaveState, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, subscribeToEvent, unsubscribeFromEventMethods inherited from class jakarta.faces.component.UIComponentencodeAll, getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getNamingContainer, getPassThroughAttributes, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, restoreTransientState, saveTransientState, setInView, setValueExpressionMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.faces.component.StateHolderisTransient, setTransient
- 
Field Details- 
COMPONENT_TYPE- See Also:
 
- 
COMPONENT_FAMILY- See Also:
 
 
- 
- 
Constructor Details- 
UIRepeatpublic UIRepeat()
 
- 
- 
Method Details- 
getFamilyDescription copied from class:UIComponentReturn the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererTypeproperty, may be used to select the appropriateRendererfor this component instance. Note this method should NOT returnnull- Overrides:
- getFamilyin class- UINamingContainer
- Returns:
- the component family (not null).
 
- 
setEnd
- 
getEnd
- 
setSize
- 
getSize
- 
setOffset
- 
getOffset
- 
setBegin
- 
getBegin
- 
setStep
- 
getStep
- 
setRowStatePreservedpublic void setRowStatePreserved(boolean rowStatePreserved) Boolean flag directing how the per-row component state of EditableValueHolderchildren should be handled across requests on the same view. If set totrue, then state forEditableValueHoldercomponents in each row will not be discarded before a new row is rendered. If not specified, the default value isfalse.This attribute should be set only when the current repeat component contains UIFormchildren which in turn containsEditableValueHolderchildren. This will only work reliably when the data model of the current repeat component does not change across requests on the same view by e.g. sorting, adding or removing rows. The alternative is to usec:forEachinstead.- Parameters:
- rowStatePreserved- Whether to preserve row state while rendering
- Since:
- 4.1
 
- 
isRowStatePreservedpublic boolean isRowStatePreserved()Returns whether row state is preserved as per setRowStatePreserved(boolean).- Returns:
- Whether row state is preserved.
- Since:
- 4.1
 
- 
getVar
- 
setVar
- 
getVarStatus
- 
setVarStatus
- 
getValue
- 
setValue
- 
getClientIdDescription copied from class:UIComponentReturn a client-side identifier for this component, generating one if necessary. The associated Renderer, if any, will be asked to convert the clientId to a form suitable for transmission to the client.The return from this method must be the same value throughout the lifetime of the instance, unless the idproperty of the component is changed, or the component is placed in aNamingContainerwhose client ID changes (for example,UIData). However, even in these cases, consecutive calls to this method must always return the same value. The implementation must follow these steps in determining the clientId:Find the closest ancestor to this component in the view hierarchy that implements NamingContainer. CallgetContainerClientId()on it and save the result as theparentIdlocal variable. CallUIComponent.getId()on this component and save the result as themyIdlocal variable. IfmyIdisnull, callcontext.getViewRoot().createUniqueId()and assign the result to myId. IfparentIdis non-null, letmyIdequalparentId +. CallUINamingContainer.getSeparatorChar(jakarta.faces.context.FacesContext)+ myIdRenderer.convertClientId(jakarta.faces.context.FacesContext, java.lang.String), passingmyId, and return the result.- Overrides:
- getClientIdin class- UIComponentBase
- Parameters:
- faces- The- FacesContextfor the current request
- Returns:
- the client id.
 
- 
process
- 
invokeOnComponentpublic boolean invokeOnComponent(FacesContext faces, String clientId, ContextCallback callback) throws FacesException Description copied from class:UIComponentBaseStarting at this component in the View hierarchy, search for a component with a clientIdequal to the argumentclientIdand, if found, call theContextCallback.invokeContextCallback(jakarta.faces.context.FacesContext, jakarta.faces.component.UIComponent)method on the argumentcallback, passing the currentFacesContextand the found component as arguments. This method is similar toUIComponent.findComponent(java.lang.String)but it does not support the leadingUINamingContainer.getSeparatorChar(jakarta.faces.context.FacesContext)syntax for searching from the root of the View.The default implementation will first check if this.getClientId()is equal to the argumentclientId. If so, first callUIComponent.pushComponentToEL(jakarta.faces.context.FacesContext, jakarta.faces.component.UIComponent), then call theContextCallback.invokeContextCallback(jakarta.faces.context.FacesContext, jakarta.faces.component.UIComponent)method on the argument callback, passing through theFacesContextargument and passing this as the component argument. Then callUIComponent.popComponentFromEL(jakarta.faces.context.FacesContext). If anExceptionis thrown by the callback, wrap it in aFacesExceptionand re-throw it. Otherwise, returntrue.Otherwise, for each component returned by UIComponent.getFacetsAndChildren(), callinvokeOnComponent()passing the arguments to this method, in order. The first timeinvokeOnComponent()returns true, abort traversing the rest of theIteratorand returntrue.When calling ContextCallback.invokeContextCallback(jakarta.faces.context.FacesContext, jakarta.faces.component.UIComponent)the implementation of this method must guarantee that the state of the component passed to the callback correctly reflects the component's position in the View hierarchy with respect to any state found in the argumentclientId. For example, an iterating component such asUIDatawill need to set its row index to correctly reflect the argumentclientIdbefore finding the appropriate child component backed by the correct row. When the callback returns, either normally or by throwing anExceptionthe implementation of this method must restore the state of the view to the way it was before invoking the callback.If none of the elements from UIComponent.getFacetsAndChildren()returnedtruefrominvokeOnComponent(), returnfalse.Simple usage example to find a component by clientId.private UIComponent found = null; private void doFind(FacesContext context, String clientId) { context.getViewRoot().invokeOnComponent(context, clientId, new ContextCallback() { public void invokeContextCallback(FacesContext context, UIComponent component) { found = component; } }); }- Overrides:
- invokeOnComponentin class- UIComponentBase
- Parameters:
- faces- the- FacesContextfor the current request
- clientId- the client identifier of the component to be passed to the argument callback.
- callback- an implementation of the Callback interface.
- Returns:
- trueif the a component with the given- clientIdis found, the callback method was successfully invoked passing that component as an argument, and no Exception was thrown. Returns- falseif no component with the given- clientIdis found.
- Throws:
- FacesException- if the argument Callback throws an Exception, it is wrapped in a- FacesExceptionand re-thrown.
 
- 
visitTreeDescription copied from class:UIComponentPerform a tree visit starting at this node in the tree. UIComponent.visitTree() implementations do not invoke the VisitCallbackdirectly, but instead callVisitContext.invokeVisitCallback(jakarta.faces.component.UIComponent, jakarta.faces.component.visit.VisitCallback)to invoke the callback. This allowsVisitContextimplementations to provide optimized tree traversals, for example by only calling theVisitCallbackfor a subset of components.UIComponent.visitTree() implementations must call UIComponent.pushComponentToEL() before performing the visit and UIComponent.popComponentFromEL() after the visit. - Overrides:
- visitTreein class- UINamingContainer
- Parameters:
- context- the- VisitContextfor this visit
- callback- the- VisitCallbackinstance whose- visitmethod will be called for each node visited.
- Returns:
- trueif tree should be visited,- falseotherwise.
- See Also:
 
- 
processDecodesDescription copied from class:UIComponentPerform the component tree processing required by the Apply Request Values phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows. - If the renderedproperty of thisUIComponentisfalse, skip further processing.
- Call UIComponent.pushComponentToEL(jakarta.faces.context.FacesContext, jakarta.faces.component.UIComponent).
- Call the processDecodes()method of all facets and children of thisUIComponent, in the order determined by a call togetFacetsAndChildren().
- Call the decode()method of this component.
- Call UIComponent.popComponentFromEL(jakarta.faces.context.FacesContext)from inside of afinally block, just before returning.
- If a RuntimeExceptionis thrown during decode processing, callFacesContext.renderResponse()and re-throw the exception.
 - Overrides:
- processDecodesin class- UIComponentBase
- Parameters:
- faces-- FacesContextfor the request we are processing
 
- If the 
- 
processUpdatesDescription copied from class:UIComponentPerform the component tree processing required by the Update Model Values phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows. - If the renderedproperty of thisUIComponentisfalse, skip further processing.
- Call UIComponent.pushComponentToEL(jakarta.faces.context.FacesContext, jakarta.faces.component.UIComponent).
- Call the processUpdates()method of all facets and children of thisUIComponent, in the order determined by a call togetFacetsAndChildren(). After returning from theprocessUpdates()method on a child or facet, callUIComponent.popComponentFromEL(jakarta.faces.context.FacesContext)
 - Overrides:
- processUpdatesin class- UIComponentBase
- Parameters:
- faces-- FacesContextfor the request we are processing
 
- If the 
- 
processValidatorsDescription copied from class:UIComponentPerform the component tree processing required by the Process Validations phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows. - If the renderedproperty of thisUIComponentisfalse, skip further processing.
- Call UIComponent.pushComponentToEL(jakarta.faces.context.FacesContext, jakarta.faces.component.UIComponent).
- Call the processValidators()method of all facets and children of thisUIComponent, in the order determined by a call togetFacetsAndChildren().
- After returning from calling getFacetsAndChildren()callUIComponent.popComponentFromEL(jakarta.faces.context.FacesContext).
 - Overrides:
- processValidatorsin class- UIComponentBase
- Parameters:
- faces-- FacesContextfor the request we are processing
- See Also:
 
- If the 
- 
broadcastDescription copied from class:UIComponentBroadcast the specified FacesEventto all registered event listeners who have expressed an interest in events of this type. Listeners are called in the order in which they were added.If the eventis an instance ofBehaviorEventand the currentcomponentis the source of theeventcallBehaviorEvent.getBehavior()to get theBehaviorfor the event. CallBehavior.broadcast(jakarta.faces.event.BehaviorEvent)on theBehaviorinstance.- Overrides:
- broadcastin class- UIComponentBase
- Parameters:
- event- The- FacesEventto be broadcast
- Throws:
- AbortProcessingException- Signal the Jakarta Faces implementation that no further processing on the current event should be performed
 
- 
queueEventDescription copied from class:UIComponentQueue an event for broadcast at the end of the current request processing lifecycle phase. The default implementation in UIComponentBasemust delegate this call to thequeueEvent()method of the parentUIComponent.- Overrides:
- queueEventin class- UIComponentBase
- Parameters:
- event-- FacesEventto be queued
 
- 
markInitialStatepublic void markInitialState()Override the base class method to take special action if the method is being invoked when StateManager.IS_BUILDING_INITIAL_STATEis true and therowStatePreservedproperty for this instance istrue.The additional action taken is to traverse the descendents and save their state without regard to any particular row value. - Specified by:
- markInitialStatein interface- PartialStateHolder
- Overrides:
- markInitialStatein class- UIComponentBase
- Since:
- 4.1
 
- 
restoreStateDescription copied from interface:StateHolderPerform any processing required to restore the state from the entries in the state Object. If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponentwith event handlers, validators, etc.) this method must call theStateHolder.restoreState(jakarta.faces.context.FacesContext, java.lang.Object)method on all those instances as well.If the stateargument isnull, take no action and return.- Specified by:
- restoreStatein interface- StateHolder
- Overrides:
- restoreStatein class- UIComponentBase
- Parameters:
- faces- the Faces context.
- object- the state.
 
- 
saveStateDescription copied from interface:StateHolderGets the state of the instance as a SerializableObject.If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponentwith event handlers, validators, etc.) this method must call theStateHolder.saveState(jakarta.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 theStateManagerThis method must not alter the state of the implementing object. In other words, after executing this code: Object state = component.saveState(facesContext);componentshould be the same as before executing it.The return from this method must be Serializable- Specified by:
- saveStatein interface- StateHolder
- Overrides:
- saveStatein class- UIComponentBase
- Parameters:
- faces- the Faces context.
- Returns:
- the saved state.
 
- 
encodeChildrenDescription copied from class:UIComponentIf our renderedproperty istrue, render the childUIComponents of thisUIComponent. This method will only be called if therendersChildrenproperty istrue.If a Rendereris associated with thisUIComponent, the actual encoding will be delegated toRenderer.encodeChildren(FacesContext, UIComponent). If noRendereris associated with thisUIComponent, iterate over each of the children of this component and callUIComponent.encodeAll(jakarta.faces.context.FacesContext).- Overrides:
- encodeChildrenin class- UIComponentBase
- Parameters:
- faces-- FacesContextfor the response we are creating
- Throws:
- IOException- if an input/output error occurs while rendering
 
- 
getRendersChildrenpublic boolean getRendersChildren()Description copied from class:UIComponentReturn a flag indicating whether this component is responsible for rendering its child components. The default implementation in UIComponentBase.getRendersChildren()tries to find the renderer for this component. If it does, it callsRenderer.getRendersChildren()and returns the result. If it doesn't, it returns false. As of version 1.2 of the Jakarta Faces Specification, component authors are encouraged to returntruefrom this method and rely onUIComponentBase.encodeChildren(jakarta.faces.context.FacesContext).- Overrides:
- getRendersChildrenin class- UIComponentBase
- Returns:
- trueif the component renders its children,- falseotherwise.
 
 
-