|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.faces.component.UIComponent
org.apache.myfaces.trinidad.component.UIXComponent
org.apache.myfaces.trinidad.component.UIXComponentBase
org.apache.myfaces.trinidad.component.UIXCollection
org.apache.myfaces.trinidad.component.UIXIterator
public class UIXIterator
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. |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.myfaces.trinidad.component.UIXCollection |
---|
UIXCollection.NoColumnFacetsVisitContext |
Nested classes/interfaces inherited from interface org.apache.myfaces.trinidad.model.LocalRowKeyIndex |
---|
LocalRowKeyIndex.Confidence, LocalRowKeyIndex.LocalCachingStrategy |
Field Summary | |
---|---|
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
|
Fields inherited from class org.apache.myfaces.trinidad.component.UIXCollection |
---|
VAR_KEY |
Fields inherited from class org.apache.myfaces.trinidad.component.UIXComponentBase |
---|
BINDING_KEY, ID_KEY, RENDERED_KEY, RENDERER_TYPE_KEY, TRANSIENT_KEY |
Fields inherited from class javax.faces.component.UIComponent |
---|
BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, CURRENT_COMPONENT, CURRENT_COMPOSITE_COMPONENT, FACETS_KEY, VIEW_LOCATION_KEY |
Fields inherited from interface javax.faces.component.NamingContainer |
---|
SEPARATOR_CHAR |
Constructor Summary | |
---|---|
|
UIXIterator()
Construct an instance of the UIXIterator. |
protected |
UIXIterator(String rendererType)
Construct an instance of the UIXIterator. |
Method Summary | ||
---|---|---|
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. |
|
|
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. |
Methods inherited from class javax.faces.component.UIComponent |
---|
encodeAll, getClientId, getCompositeComponentParent, getCurrentComponent, getCurrentCompositeComponent, getNamingContainer, getResourceBundleMap, isCompositeComponent, isInView, popComponentFromEL, pushComponentToEL, setInView |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.myfaces.trinidad.model.LocalRowKeyIndex |
---|
areRowsLocallyAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, clearCachedRow, clearCachedRow, clearCachedRows, clearCachedRows, clearLocalCache, getCachingStrategy, getEstimatedRowCount, getEstimatedRowCountConfidence, isRowLocallyAvailable, isRowLocallyAvailable |
Field Detail |
---|
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
Constructor Detail |
---|
public UIXIterator()
protected UIXIterator(String rendererType)
Method Detail |
---|
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
childProcessor
true
if this FlattenedComponent actually processed any children
IOException
- 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 children
isFlatteningChildren
in interface FlattenedComponent
context
- FacesContext
true
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)
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 callback
UIXCollection.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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |