public class UIXIterator extends UIXCollection implements LocalRowKeyIndex, FlattenedComponent
UIXIterator is a component that performs iteration over its child components. It is similar to UIXTable but has no chrome. Each child is repeatedly stamped as many times as necessary. Iteration is done starting at the index given by the "first" attribute, for as many indices as specified by the "rows" attribute. If "rows" returns 0, then the iteration continues until there are no more elements in the underlying data.
While the <tr:forEach> will be sufficient for most user's needs, it does not work with a JSF DataModel, or CollectionModel. It also cannot be bound to EL expressions that use component-managed EL variables (such as the "var" variable on an <tr:table>), because a forEach tag runs during The <tr:iterator> tag was created to address these issues.
To list all, the benefits of UIXIterator over forEach:
By default, it processes up to 25 rows. Use the rows attribute to alter this behavior.
Type | Phases | Description |
---|---|---|
org.apache.myfaces.trinidad.event.AttributeChangeEvent |
Invoke Application Apply Request Values |
Event delivered to describe an attribute change. Attribute change events are not delivered for any programmatic change to a property. They are only delivered when a renderer changes a property without the application's specific request. An example of an attribute change event might include the width of a column that supported client-side resizing. |
UIXCollection.NoColumnFacetsVisitContext
LocalRowKeyIndex.Confidence, LocalRowKeyIndex.LocalCachingStrategy
Modifier and Type | Field and Description |
---|---|
static String |
COMPONENT_FAMILY |
static String |
COMPONENT_TYPE |
static PropertyKey |
FIRST_KEY |
static PropertyKey |
ROWS_KEY |
static FacesBean.Type |
TYPE |
static PropertyKey |
VALUE_KEY |
static PropertyKey |
VAR_STATUS_KEY |
VAR_KEY
BINDING_KEY, ID_KEY, RENDERED_KEY, RENDERER_TYPE_KEY, TRANSIENT_KEY
Modifier | Constructor and Description |
---|---|
|
UIXIterator()
Construct an instance of the UIXIterator.
|
protected |
UIXIterator(String rendererType)
Construct an instance of the UIXIterator.
|
Modifier and Type | Method and Description |
---|---|
protected CollectionModel |
createCollectionModel(CollectionModel current,
Object value)
Creates the CollectionModel to use with this component.
|
protected Map<String,Object> |
createVarStatusMap()
Enhances the varStatusMap created by the super class to include:
begin - the index of the first row being rendered
first - true if the current row is the first row
count - indicates which iteration this is.
|
void |
encodeChildren(javax.faces.context.FacesContext context)
Repeatedly render the children as many times as needed.
|
protected FacesBean.Type |
getBeanType() |
String |
getFamily() |
int |
getFirst()
Gets the index of the first row in the currently range of rows.
|
boolean |
getRendersChildren()
Override to return true.
|
int |
getRows()
Gets the maximum number of rows to display in a single range of rows.
|
Object |
getValue()
Gets the data model being used by this component.
|
String |
getVarStatus()
Gets
Name of the EL variable used to reference the varStatus information.
|
boolean |
isFlatteningChildren(javax.faces.context.FacesContext context)
Returns
true if this FlattenedComponent is currently flattening its children |
protected void |
processFacetsAndChildren(javax.faces.context.FacesContext context,
javax.faces.event.PhaseId phaseId)
Process this component's facets and children.
|
<S> boolean |
processFlattenedChildren(javax.faces.context.FacesContext context,
ComponentProcessingContext cpContext,
ComponentProcessor<S> childProcessor,
S callbackContext)
Sets up the iteration context for each child and processes it
|
void |
setFirst(int first)
Sets the index of the first row in the currently range of rows.
|
void |
setRows(int rows)
Sets the maximum number of rows to display in a single range of rows.
|
void |
setValue(Object value)
Sets the data model being used by this component.
|
void |
setVarStatus(String varStatus)
Sets
Name of the EL variable used to reference the varStatus information.
|
protected boolean |
visitData(javax.faces.component.visit.VisitContext visitContext,
javax.faces.component.visit.VisitCallback visitCallback)
Visit the rows and children of the columns of the collection per row-index.
|
areRowsAvailable, areRowsAvailable, areRowsAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, broadcast, clearCachedRow, clearCachedRow, clearCachedRows, clearCachedRows, clearCurrencyStringCache, clearLocalCache, decodeChildrenImpl, defaultVisitChildren, encodeBegin, encodeEnd, ensureRowsAvailable, getCachingStrategy, getClientRowKey, getClientRowKeyManager, getCollectionModel, getCollectionModel, getContainerClientId, getCurrencyString, getEstimatedRowCount, getEstimatedRowCountConfidence, getRowCount, getRowData, getRowData, getRowData, getRowIndex, getRowKey, getSortCriteria, getStamps, getVar, invokeOnComponent, isRowAvailable, isRowAvailable, isRowAvailable, isRowLocallyAvailable, isRowLocallyAvailable, isSortable, postCreateCollectionModel, postRowDataChange, preRowDataChange, processComponent, processDecodes, processEvent, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, resetStampState, restoreStampState, restoreState, saveStampState, saveState, setClientRowKey, setCurrencyString, setRowIndex, setRowKey, setSortCriteria, setupVisitingContext, setVar, tearDownVisitingContext, updateChildrenImpl, validateChildrenImpl, visitChildren, visitChildrenWithoutIterating, visitUnstampedFacets
adaptMethodBinding, addAttributeChange, addAttributeChangeListener, addClientBehavior, addComponentChange, addComponentChange, addComponentChangeFilter, addFacesListener, broadcastToMethodBinding, broadcastToMethodExpression, clearInitialState, createFacesBean, decode, decodeChildren, findComponent, getAttributeChangeListener, getAttributeChangeListeners, getAttributes, getBooleanProperty, getChildCount, getChildren, getClientBehaviors, getClientId, getContainerClientId, getDefaultEventName, getFacesBean, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacetNames, getFacets, getFacetsAndChildren, getId, getIntProperty, getLifecycleRenderer, getListenersForEventClass, getParent, getProperty, getPropertyKey, getRenderedFacetsAndChildren, getRenderer, getRendererType, getValueBinding, getValueExpression, initialStateMarked, invokeOnChildrenComponents, invokeOnNamingContainerComponent, isRendered, isTransient, markInitialState, removeAttributeChangeListener, removeComponentChangeFilter, removeFacesListener, satisfiesPartialTrigger, setAttributeChangeListener, setAttributeChangeListener, setBooleanProperty, setId, setIntProperty, setParent, setProperty, setRendered, setRendererType, setTransient, setupFlattenedChildrenContext, setupFlattenedContext, setValueBinding, setValueExpression, subscribeToEvent, tearDownFlattenedChildrenContext, tearDownFlattenedContext, toString, unsubscribeFromEvent, updateChildren, validateChildren
addPartialTarget, clearCachedClientIds, clearCachedClientIds, encodeFlattenedChild, encodeFlattenedChildren, getLogicalParent, getLogicalParent, getStateHelper, getStateHelper, isVisitable, partialEncodeVisit, processFlattenedChildren, processFlattenedChildren, processFlattenedChildren, processFlattenedChildren, setPartialTarget, setupChildrenEncodingContext, setupChildrenVisitingContext, setupEncodingContext, setUpEncodingContext, tearDownChildrenEncodingContext, tearDownChildrenVisitingContext, tearDownEncodingContext, visitAllChildren, visitChildren, visitTree, visitTree
encodeAll, getClientId, getCompositeComponentParent, getCurrentComponent, getCurrentCompositeComponent, getNamingContainer, getResourceBundleMap, isCompositeComponent, isInView, popComponentFromEL, pushComponentToEL, setInView
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
areRowsLocallyAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, clearCachedRow, clearCachedRow, clearCachedRows, clearCachedRows, clearLocalCache, getCachingStrategy, getEstimatedRowCount, getEstimatedRowCountConfidence, isRowLocallyAvailable, isRowLocallyAvailable
public static final FacesBean.Type TYPE
public static final PropertyKey VAR_STATUS_KEY
public static final PropertyKey VALUE_KEY
public static final PropertyKey ROWS_KEY
public static final PropertyKey FIRST_KEY
public static final String COMPONENT_FAMILY
public static final String COMPONENT_TYPE
public UIXIterator()
protected UIXIterator(String rendererType)
public boolean getRendersChildren()
getRendersChildren
in class UIXComponentBase
public <S> boolean processFlattenedChildren(javax.faces.context.FacesContext context, ComponentProcessingContext cpContext, ComponentProcessor<S> childProcessor, S callbackContext) throws IOException
processFlattenedChildren
in interface FlattenedComponent
context
- Current FacesContextcpContext
- ComponentProcesingContext represetning the current child iteration statechildProcessor
- ComponentProcessor to call for each flattened childcallbackContext
- childProcessor-specific context to be passed on each call to the
childProcessortrue
if this FlattenedComponent actually processed any childrenIOException
- if an error occurs while processing childrenUIXComponent.processFlattenedChildren(FacesContext, ComponentProcessingContext, ComponentProcessor, UIComponent, Object)
,
UIXComponent.processFlattenedChildren(FacesContext, ComponentProcessingContext, ComponentProcessor, Iterable, Object)
,
FlattenedComponent.isFlatteningChildren(javax.faces.context.FacesContext)
public boolean isFlatteningChildren(javax.faces.context.FacesContext context)
true
if this FlattenedComponent is currently flattening its childrenisFlatteningChildren
in interface FlattenedComponent
context
- FacesContexttrue
if this FlattenedComponent is currently flattening its childrenFlattenedComponent.processFlattenedChildren(javax.faces.context.FacesContext, org.apache.myfaces.trinidad.component.ComponentProcessingContext, org.apache.myfaces.trinidad.component.ComponentProcessor<S>, S)
public void encodeChildren(javax.faces.context.FacesContext context) throws IOException
encodeChildren
in class UIXComponentBase
IOException
protected Map<String,Object> createVarStatusMap()
createVarStatusMap
in class UIXCollection
protected CollectionModel createCollectionModel(CollectionModel current, Object value)
UIXCollection
postCreateCollectionModel
createCollectionModel
in class UIXCollection
current
- the current CollectionModel, or null if there is none.value
- this is the value returned from UIXCollection.getValue()
UIXCollection.postCreateCollectionModel(org.apache.myfaces.trinidad.model.CollectionModel)
protected void processFacetsAndChildren(javax.faces.context.FacesContext context, javax.faces.event.PhaseId phaseId)
UIXCollection
UIXCollection.processComponent(javax.faces.context.FacesContext, javax.faces.component.UIComponent, javax.faces.event.PhaseId)
as many times as necessary for each facet and child.
UIXCollection.processComponent(javax.faces.context.FacesContext, javax.faces.component.UIComponent, javax.faces.event.PhaseId)
may be called repeatedly for the same child if that child is
being stamped.processFacetsAndChildren
in class UIXCollection
protected boolean visitData(javax.faces.component.visit.VisitContext visitContext, javax.faces.component.visit.VisitCallback visitCallback)
UIXCollection
visitData
in class UIXCollection
visitContext
- The visiting contextvisitCallback
- The visit callbackUIXCollection.visitChildren(VisitContext, VisitCallback)
public final String getVarStatus()
getVarStatus
in class UIXCollection
UIXCollection.createVarStatusMap()
public final void setVarStatus(String varStatus)
varStatus
- the new varStatus valuepublic final Object getValue()
org.apache.myfaces.trinidad.model.CollectionModel
.
You may also use other model instances, e.g.,
java.util.List
,
array, and javax.faces.model.DataModel
.
This component will automatically convert the instance
into a CollectionModel
.getValue
in class UIXCollection
public final void setValue(Object value)
org.apache.myfaces.trinidad.model.CollectionModel
.
You may also use other model instances, e.g.,
java.util.List
,
array, and javax.faces.model.DataModel
.
This component will automatically convert the instance
into a CollectionModel
.value
- the new value valuepublic final int getRows()
public final void setRows(int rows)
rows
- the new rows valuepublic final int getFirst()
public final void setFirst(int first)
first
- the new first valuepublic String getFamily()
getFamily
in class UIXComponentBase
protected FacesBean.Type getBeanType()
getBeanType
in class UIXComponentBase
Copyright © 2001-2016 The Apache Software Foundation. All Rights Reserved.