public class UIRepeat
extends javax.faces.component.UINamingContainer
| Modifier and Type | Field and Description |
|---|---|
static String |
COMPONENT_FAMILY |
static String |
COMPONENT_TYPE |
| Constructor and Description |
|---|
UIRepeat() |
| Modifier and Type | Method and Description |
|---|---|
void |
broadcast(javax.faces.event.FacesEvent event)
Broadcast the specified
FacesEvent to all registered event listeners who
have expressed an interest in events of this type. |
void |
encodeChildren(javax.faces.context.FacesContext faces)
If our
rendered property is true, render the child
UIComponents of this UIComponent. |
Integer |
getBegin() |
String |
getClientId(javax.faces.context.FacesContext faces)
Return a client-side identifier for this component, generating one if necessary.
|
Integer |
getEnd() |
String |
getFamily()
Return the identifier of the component family to which this component belongs. |
Integer |
getOffset() |
boolean |
getRendersChildren()
Return a flag indicating whether this component is responsible for rendering its
child components.
|
Integer |
getSize() |
Integer |
getStep() |
Object |
getValue() |
String |
getVar() |
String |
getVarStatus() |
boolean |
invokeOnComponent(javax.faces.context.FacesContext faces,
String clientId,
javax.faces.component.ContextCallback callback)
Starting at this component in the View
hierarchy, search for a component with a
clientId equal to the
argument clientId and, if found, call the
ContextCallback.invokeContextCallback(javax.faces.context.FacesContext, javax.faces.component.UIComponent) method on the argument
callback, passing the current FacesContext and the found
component as arguments. |
void |
process(javax.faces.context.FacesContext faces,
javax.faces.event.PhaseId phase) |
void |
processDecodes(javax.faces.context.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.
|
void |
processUpdates(javax.faces.context.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.
|
void |
processValidators(javax.faces.context.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.
|
void |
queueEvent(javax.faces.event.FacesEvent event)
Queue an event for broadcast at the end of the current request processing lifecycle
phase.
|
void |
restoreState(javax.faces.context.FacesContext faces,
Object object)
Perform any
processing required to restore the state from the entries in the
state Object.
|
Object |
saveState(javax.faces.context.FacesContext faces)
Gets the state of the instance as a
Serializable Object. |
void |
setBegin(Integer begin) |
void |
setEnd(Integer end) |
void |
setOffset(Integer offset) |
void |
setSize(Integer size) |
void |
setStep(Integer step) |
void |
setValue(Object value) |
void |
setVar(String var) |
void |
setVarStatus(String varStatus) |
boolean |
visitTree(javax.faces.component.visit.VisitContext context,
javax.faces.component.visit.VisitCallback callback)
Perform a tree visit starting at this node in the tree. |
createUniqueId, getSeparatorCharaddClientBehavior, addFacesListener, clearInitialState, decode, encodeBegin, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getDefaultEventName, getEventNames, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getListenersForEventClass, getParent, getPassThroughAttributes, getRenderer, getRendererType, getValueBinding, isRendered, isTransient, markInitialState, processRestoreState, processSaveState, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding, subscribeToEvent, unsubscribeFromEventencodeAll, getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getNamingContainer, getPassThroughAttributes, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, restoreTransientState, saveTransientState, setInView, setValueExpressionpublic static final String COMPONENT_TYPE
public static final String COMPONENT_FAMILY
public String getFamily()
javax.faces.component.UIComponent
Return the identifier of the component family to which this component belongs. This
identifier, in conjunction with the value of the rendererType
property, may be used to select the appropriate Renderer for this component
instance. Note this method should NOT return null
getFamily in class javax.faces.component.UINamingContainerpublic void setEnd(Integer end)
public Integer getEnd()
public void setSize(Integer size)
public Integer getSize()
public void setOffset(Integer offset)
public Integer getOffset()
public void setBegin(Integer begin)
public Integer getBegin()
public void setStep(Integer step)
public Integer getStep()
public String getVar()
public void setVar(String var)
public String getVarStatus()
public void setVarStatus(String varStatus)
public Object getValue()
public void setValue(Object value)
public String getClientId(javax.faces.context.FacesContext faces)
javax.faces.component.UIComponent
Return 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 id property of the component is changed, or the
component is placed in a NamingContainer whose 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. Call getContainerClientId()
on it and save the result as the parentId local variable. Call
UIComponent.getId() on this component and save the result as the
myId local variable. If myId is null, call
context.getViewRoot().createUniqueId() and assign the result to myId.
If parentId is non-null, let myId equal
parentId
+ . Call
UINamingContainer.getSeparatorChar(javax.faces.context.FacesContext) + myIdRenderer.convertClientId(javax.faces.context.FacesContext, java.lang.String), passing myId, and return the result.
getClientId in class javax.faces.component.UIComponentBasefaces - The FacesContext for the current requestpublic void process(javax.faces.context.FacesContext faces,
javax.faces.event.PhaseId phase)
public boolean invokeOnComponent(javax.faces.context.FacesContext faces,
String clientId,
javax.faces.component.ContextCallback callback)
throws javax.faces.FacesException
javax.faces.component.UIComponentBase
Starting at this component in the View
hierarchy, search for a component with a clientId equal to the
argument clientId and, if found, call the
ContextCallback.invokeContextCallback(javax.faces.context.FacesContext, javax.faces.component.UIComponent) method on the argument
callback, passing the current FacesContext and the found
component as arguments. This method is similar to UIComponent.findComponent(java.lang.String) but it
does not support the leading UINamingContainer.getSeparatorChar(javax.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 argument clientId. If so,
first call UIComponent.pushComponentToEL(javax.faces.context.FacesContext, javax.faces.component.UIComponent), then
call the ContextCallback.invokeContextCallback(javax.faces.context.FacesContext, javax.faces.component.UIComponent) method on the argument
callback, passing through the FacesContext argument and passing this
as the component argument. Then call
UIComponent.popComponentFromEL(javax.faces.context.FacesContext). If an Exception is thrown by the
callback, wrap it in a FacesException and re-throw it. Otherwise, return
true.
Otherwise, for each component returned by UIComponent.getFacetsAndChildren(), call
invokeOnComponent() passing the arguments to this method, in order.
The first time invokeOnComponent() returns true, abort traversing the
rest of the Iterator and return true.
When calling ContextCallback.invokeContextCallback(javax.faces.context.FacesContext, javax.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 argument clientId. For example, an iterating
component such as UIData will need to set its row index to correctly
reflect the argument clientId before finding the appropriate child
component backed by the correct row. When the callback returns, either normally or
by throwing an Exception the 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() returned
true from invokeOnComponent(), return false.
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;
}
});
}
invokeOnComponent in class javax.faces.component.UIComponentBasefaces - the FacesContext for the current requestclientId - the client identifier of the component to be passed to the argument
callback.callback - an implementation of the Callback interface.true if the a component with the given clientId
is found, the callback method was successfully invoked passing that
component as an argument, and no Exception was thrown. Returns
false if no component with the given clientId is
found.javax.faces.FacesException - if the argument Callback throws an Exception, it is wrapped in a
FacesException and re-thrown.public boolean visitTree(javax.faces.component.visit.VisitContext context,
javax.faces.component.visit.VisitCallback callback)
javax.faces.component.UIComponentPerform a tree visit starting at this node in the tree.
UIComponent.visitTree() implementations do not invoke the VisitCallback
directly, but instead call VisitContext.invokeVisitCallback(javax.faces.component.UIComponent, javax.faces.component.visit.VisitCallback) to invoke the
callback. This allows VisitContext implementations to provide optimized
tree traversals, for example by only calling the VisitCallback for a subset of components.
UIComponent.visitTree() implementations must call UIComponent.pushComponentToEL() before performing the visit and UIComponent.popComponentFromEL() after the visit.
visitTree in class javax.faces.component.UINamingContainercontext - the VisitContext for this visitcallback - the VisitCallback instance whose visit method
will be called for each node visited.true if tree should be visited, false otherwise.UIComponent.visitTree(javax.faces.component.visit.VisitContext, javax.faces.component.visit.VisitCallback)public void processDecodes(javax.faces.context.FacesContext faces)
javax.faces.component.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.
rendered property of this UIComponent is
false, skip further processing.UIComponent.pushComponentToEL(javax.faces.context.FacesContext, javax.faces.component.UIComponent).processDecodes() method of all facets and children of
this UIComponent, in the order determined by a call to
getFacetsAndChildren().decode() method of this component.UIComponent.popComponentFromEL(javax.faces.context.FacesContext) from inside of a
finally block, just before returning.RuntimeException is thrown during decode processing, call
FacesContext.renderResponse() and re-throw the exception.processDecodes in class javax.faces.component.UIComponentBasefaces - FacesContext for the request we are processingpublic void processUpdates(javax.faces.context.FacesContext faces)
javax.faces.component.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.
rendered property of this UIComponent is
false, skip further processing.UIComponent.pushComponentToEL(javax.faces.context.FacesContext, javax.faces.component.UIComponent).processUpdates() method of all facets and children of
this UIComponent, in the order determined by a call to
getFacetsAndChildren(). After
returning from the processUpdates() method on a child or facet, call
UIComponent.popComponentFromEL(javax.faces.context.FacesContext)processUpdates in class javax.faces.component.UIComponentBasefaces - FacesContext for the request we are processingpublic void processValidators(javax.faces.context.FacesContext faces)
javax.faces.component.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.
rendered property of this UIComponent is
false, skip further processing.UIComponent.pushComponentToEL(javax.faces.context.FacesContext, javax.faces.component.UIComponent).processValidators() method of all facets and children of
this UIComponent, in the order determined by a call to
getFacetsAndChildren().getFacetsAndChildren() call
UIComponent.popComponentFromEL(javax.faces.context.FacesContext).processValidators in class javax.faces.component.UIComponentBasefaces - FacesContext for the request we are processingPreValidateEvent,
PostValidateEventpublic void broadcast(javax.faces.event.FacesEvent event)
throws javax.faces.event.AbortProcessingException
javax.faces.component.UIComponent
Broadcast the specified FacesEvent to 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 event is an instance of BehaviorEvent
and the current component is the source of the event call
BehaviorEvent.getBehavior() to get the
Behavior for the event.
Call
Behavior.broadcast(javax.faces.event.BehaviorEvent)
on the Behavior instance.
broadcast in class javax.faces.component.UIComponentBaseevent - The FacesEvent to be broadcastjavax.faces.event.AbortProcessingException - Signal the Jakarta Server Faces implementation that no further processing
on the current event should be performedpublic void queueEvent(javax.faces.event.FacesEvent event)
javax.faces.component.UIComponent
Queue an event for broadcast at the end of the current request processing lifecycle
phase. The default implementation in UIComponentBase must delegate this
call to the queueEvent() method of the parent UIComponent.
queueEvent in class javax.faces.component.UIComponentBaseevent - FacesEvent to be queuedpublic void restoreState(javax.faces.context.FacesContext faces,
Object object)
javax.faces.component.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
UIComponent with event handlers, validators, etc.)
this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those
instances as well.
If the state
argument is null, take no action and return.
restoreState in interface javax.faces.component.StateHolderrestoreState in class javax.faces.component.UIComponentBasefaces - the Faces context.object - the state.public Object saveState(javax.faces.context.FacesContext faces)
javax.faces.component.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
saveState in interface javax.faces.component.StateHoldersaveState in class javax.faces.component.UIComponentBasefaces - the Faces context.public void encodeChildren(javax.faces.context.FacesContext faces)
throws IOException
javax.faces.component.UIComponent
If our rendered property is true, render the child
UIComponents of this UIComponent. This method will only be called
if the rendersChildren property is true.
If a Renderer is associated with this UIComponent, the actual
encoding will be delegated to
Renderer.encodeChildren(FacesContext, UIComponent).
If no Renderer is associated with this
UIComponent, iterate over each of the children of this component and call
UIComponent.encodeAll(javax.faces.context.FacesContext).
encodeChildren in class javax.faces.component.UIComponentBasefaces - FacesContext for the response we are creatingIOException - if an input/output error occurs while renderingpublic boolean getRendersChildren()
javax.faces.component.UIComponent
Return 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 calls Renderer.getRendersChildren() and returns the
result. If it doesn't, it returns false. As of version 1.2 of the Jakarta Server Faces
Specification, component authors are encouraged to return true from
this method and rely on UIComponentBase.encodeChildren(javax.faces.context.FacesContext).
getRendersChildren in class javax.faces.component.UIComponentBasetrue if the component renders its children, false
otherwise.Copyright © 2010–2024 JBoss by Red Hat. All rights reserved.