|
||||||||||
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:
Type | Phases | Description |
---|---|---|
org.apache.myfaces.trinidad.event.AttributeChangeEvent |
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 events might include the width of a column that supported client-side resizing. |
Field Summary | |
---|---|
static java.lang.String |
COMPONENT_FAMILY
|
static java.lang.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 |
---|
bindings |
Fields inherited from interface javax.faces.component.NamingContainer |
---|
SEPARATOR_CHAR |
Constructor Summary | |
---|---|
|
UIXIterator()
Construct an instance of the UIXIterator. |
protected |
UIXIterator(java.lang.String rendererType)
Construct an instance of the UIXIterator. |
Method Summary | |
---|---|
protected CollectionModel |
createCollectionModel(CollectionModel current,
java.lang.Object value)
Creates the CollectionModel to use with this component. |
protected java.util.Map<java.lang.String,java.lang.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()
|
java.lang.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. |
java.lang.Object |
getValue()
Gets the data model being used by this component. |
java.lang.String |
getVarStatus()
Gets Name of the EL variable used to reference the varStatus information. |
protected void |
processFacetsAndChildren(javax.faces.context.FacesContext context,
javax.faces.event.PhaseId phaseId)
Process this component's facets and children. |
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(java.lang.Object value)
Sets the data model being used by this component. |
void |
setVarStatus(java.lang.String varStatus)
Sets Name of the EL variable used to reference the varStatus information. |
Methods inherited from class org.apache.myfaces.trinidad.component.UIXCollection |
---|
broadcast, clearCurrencyStringCache, decodeChildrenImpl, encodeBegin, encodeEnd, getClientRowKey, getClientRowKeyManager, getCollectionModel, getCollectionModel, getContainerClientId, getCurrencyString, getRowCount, getRowData, getRowData, getRowIndex, getRowKey, getSortCriteria, getStamps, getVar, invokeOnComponent, isRowAvailable, isRowAvailable, isSortable, postRowDataChange, preRowDataChange, processComponent, processDecodes, processSaveState, queueEvent, resetStampState, restoreStampState, restoreState, saveStampState, saveState, setClientRowKey, setCurrencyString, setRowIndex, setRowKey, setSortCriteria, setVar, updateChildrenImpl, validateChildrenImpl |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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 java.lang.String COMPONENT_FAMILY
public static final java.lang.String COMPONENT_TYPE
Constructor Detail |
---|
public UIXIterator()
protected UIXIterator(java.lang.String rendererType)
Method Detail |
---|
public boolean getRendersChildren()
getRendersChildren
in class UIXComponentBase
public void encodeChildren(javax.faces.context.FacesContext context) throws java.io.IOException
encodeChildren
in class UIXComponentBase
java.io.IOException
protected java.util.Map<java.lang.String,java.lang.Object> createVarStatusMap()
createVarStatusMap
in class UIXCollection
protected CollectionModel createCollectionModel(CollectionModel current, java.lang.Object value)
UIXCollection
createCollectionModel
in class UIXCollection
current
- the current CollectionModel, or null if there is none.value
- this is the value returned from UIXCollection.getValue()
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
public final java.lang.String getVarStatus()
getVarStatus
in class UIXCollection
UIXCollection.createVarStatusMap()
public final void setVarStatus(java.lang.String varStatus)
varStatus
- the new varStatus valuepublic final java.lang.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(java.lang.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 java.lang.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 |