com.ibm.xsp.component
Class UIRepeat

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by com.ibm.xsp.component.UIRepeat
All Implemented Interfaces:
FacesComponent, FacesDataIterator, FacesRowIndex, javax.faces.component.StateHolder

public class UIRepeat
extends javax.faces.component.UIComponentBase
implements FacesComponent, FacesDataIterator

This is the xp:repeat tag when repeatControls="true", when the check box "Create controls at page creation" is checked. UIRepeat is a UIComponent that supports data binding to a collection of data objects represented by a DataModel instance, which is the current value of this component itself (typically established via a ValueBinding). This component is responsible for the creation of it's own children. It does this by iterating over the data in the data model, and for each row it create a panel which will contain one instance of each of it's children. The repeated panel has a data context corresponding to the data object for the current row. This data will be is exposed as a request attribute under the key specified by the var property. Not intended to be subclassed.


Nested Class Summary
 
Nested classes/interfaces inherited from class javax.faces.component.UIComponentBase
javax.faces.component.UIComponentBase.AggregatedIterator, javax.faces.component.UIComponentBase.UnmodifiableIterator
 
Nested classes/interfaces inherited from class javax.faces.component.UIComponent
javax.faces.component.UIComponent.StateMap, javax.faces.component.UIComponent.StateMapEntry
 
Field Summary
static java.lang.String COMPONENT_FAMILY
           
static java.lang.String COMPONENT_TYPE
           
static java.lang.String INDEX
           
static java.lang.String RENDERER_TYPE
           
 
Fields inherited from class javax.faces.component.UIComponentBase
EMPTY_ITERATOR
 
Fields inherited from class javax.faces.component.UIComponent
_xspStateId
 
Constructor Summary
UIRepeat()
          Create a new UIRepeat instance with default property values.
 
Method Summary
 void _xspCleanTransientData()
           
 void broadcast(javax.faces.event.FacesEvent event)
           
 void buildContents(javax.faces.context.FacesContext context, FacesComponentBuilder builder)
          Build the component children and facets, the default implementation is usually:
builder.buildAll(context, this, true); // includeFacets=true
 void encodeChildren(javax.faces.context.FacesContext context)
           
 javax.faces.model.DataModel getDataModel()
           
 java.lang.String getDir()
           
 java.lang.String getFamily()
           
 int getFirst()
           Return the value of the first property.
 java.lang.String getIndexVar()
           
 int getRowCount()
          Return the number of rows in the underlying data model.
 int getRowIndex()
          Return the index of the current row the underlying data model.
 int getRows()
          Return the value of the rows property.
 java.lang.Object getValue()
          Return the value of the repeat panel.
 java.lang.String getVar()
           
 boolean gotoFirstPage()
          Always fails with an exception, may be accidentally called when the application designer intended to use com.ibm.xsp.component.UIDataIterator.gotoFirstPage().
 boolean gotoLastPage()
          Always fails with an exception, may be accidentally called when the application designer intended to use com.ibm.xsp.component.UIDataIterator.gotoLastPage().
 boolean gotoNextPage()
          Always fails with an exception, may be accidentally called when the application designer intended to use com.ibm.xsp.component.UIDataIterator.gotoNextPage().
 boolean gotoPreviousPage()
          Always fails with an exception, may be accidentally called when the application designer intended to use com.ibm.xsp.component.UIDataIterator.gotoPreviousPage().
 boolean gotoRow(int row)
          Always fails with an exception, may be accidentally called when the application designer intended to use com.ibm.xsp.component.UIDataIterator.gotoRow(int).
 void initAfterContents(javax.faces.context.FacesContext context)
          Perform component initialization after it's children and facets are added.
 void initBeforeContents(javax.faces.context.FacesContext context)
          Perform component initialization before its children and facets are added.
 boolean isRemoveRepeat()
          Return the value of the removeRepeat property.
 void processDecodes(javax.faces.context.FacesContext context)
           
 void processUpdates(javax.faces.context.FacesContext context)
           
 void processValidators(javax.faces.context.FacesContext context)
           
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setDir(java.lang.String dir)
           
 void setFirst(int first)
          Set the value of the first property.
 void setIndexVar(java.lang.String indexVar)
           
 void setRemoveRepeat(boolean remove)
          Set the value of the removeRepeat property.
 void setRows(int rows)
          Set the value of the rows property.
 void setValue(java.lang.Object value)
          Set the value of the repeat panel.
 void setValueBinding(java.lang.String name, javax.faces.el.ValueBinding valueBinding)
           
 void setVar(java.lang.String var)
           
 
Methods inherited from class javax.faces.component.UIComponentBase
_xspGetReadOnlyObj, _xspGetRendererData, _xspRemoveReadOnlyObj, _xspRemoveRendererData, _xspSetIdUnchecked, _xspSetReadOnlyObj, _xspSetRendererData, addFacesListener, decode, encodeBegin, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
 
Methods inherited from class javax.faces.component.UIComponent
_xspGetStateId, _xspGetStateMap, _xspRestoreAttribute, _xspRestoreState, _xspSaveState, invokeOnComponent, isVisitable, markInitialState, setControlState, visitTree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPONENT_TYPE

public static final java.lang.String COMPONENT_TYPE
See Also:
Constant Field Values

COMPONENT_FAMILY

public static final java.lang.String COMPONENT_FAMILY
See Also:
Constant Field Values

RENDERER_TYPE

public static final java.lang.String RENDERER_TYPE
See Also:
Constant Field Values

INDEX

public static final java.lang.String INDEX
See Also:
Constant Field Values
Constructor Detail

UIRepeat

public UIRepeat()
Create a new UIRepeat instance with default property values.

Method Detail

getFirst

public int getFirst()

Return the value of the first property. Contents:

The index of the first row of data to process (first row is 0).

Note, while this does check for a run time binding if present, it is only invoked at page load time, so its value during any subsequent phase is ignored.

Specified by:
getFirst in interface FacesDataIterator

setFirst

public void setFirst(int first)

Set the value of the first property.

Specified by:
setFirst in interface FacesDataIterator

getRows

public int getRows()

Return the value of the rows property. Contents:

The amount of rows to process starting from the index.

Note, while this does check for a run time binding if present, it is only invoked at page load time, so its value during any subsequent phase is ignored.

Specified by:
getRows in interface FacesDataIterator

setRows

public void setRows(int rows)

Set the value of the rows property.

Specified by:
setRows in interface FacesDataIterator

isRemoveRepeat

public boolean isRemoveRepeat()

Return the value of the removeRepeat property. Contents:

A boolean flag indicating the repeat should be removed after repeating it's child controls. Note: This only works if it repeats a single child which is a naming container.


setRemoveRepeat

public void setRemoveRepeat(boolean remove)

Set the value of the removeRepeat property.


_xspCleanTransientData

public void _xspCleanTransientData()
Overrides:
_xspCleanTransientData in class javax.faces.component.UIComponentBase

getFamily

public java.lang.String getFamily()
Specified by:
getFamily in class javax.faces.component.UIComponent

getRowCount

public int getRowCount()
Return the number of rows in the underlying data model. If the number of available rows is unknown, return -1.

Returns:
Return the number of rows in the underlying data model.

getRowIndex

public int getRowIndex()
Return the index of the current row the underlying data model. If the row index is unknown, return -1.

Specified by:
getRowIndex in interface FacesDataIterator
Specified by:
getRowIndex in interface FacesRowIndex
Returns:
Return the index of the current row the underlying data model.

getVar

public java.lang.String getVar()
Returns:
Returns the var.

gotoFirstPage

public boolean gotoFirstPage()
Always fails with an exception, may be accidentally called when the application designer intended to use com.ibm.xsp.component.UIDataIterator.gotoFirstPage().

Returns:

gotoPreviousPage

public boolean gotoPreviousPage()
Always fails with an exception, may be accidentally called when the application designer intended to use com.ibm.xsp.component.UIDataIterator.gotoPreviousPage().

Returns:

gotoNextPage

public boolean gotoNextPage()
Always fails with an exception, may be accidentally called when the application designer intended to use com.ibm.xsp.component.UIDataIterator.gotoNextPage().

Returns:

gotoLastPage

public boolean gotoLastPage()
Always fails with an exception, may be accidentally called when the application designer intended to use com.ibm.xsp.component.UIDataIterator.gotoLastPage().

Returns:

gotoRow

public boolean gotoRow(int row)
Always fails with an exception, may be accidentally called when the application designer intended to use com.ibm.xsp.component.UIDataIterator.gotoRow(int).

Returns:

setIndexVar

public void setIndexVar(java.lang.String indexVar)
Parameters:
indexVar - The index var to set.

getIndexVar

public java.lang.String getIndexVar()
Returns:
Returns the index var.

setVar

public void setVar(java.lang.String var)
Parameters:
var - The var to set.

getValue

public java.lang.Object getValue()
Return the value of the repeat panel.

Returns:
Returns the value.

setValue

public void setValue(java.lang.Object value)
Set the value of the repeat panel. This value must either be be of type DataModel, or a type that can be adapted into a DataModel.

Parameters:
value - The value to set.

setValueBinding

public void setValueBinding(java.lang.String name,
                            javax.faces.el.ValueBinding valueBinding)
Overrides:
setValueBinding in class javax.faces.component.UIComponentBase

initBeforeContents

public void initBeforeContents(javax.faces.context.FacesContext context)
                        throws javax.faces.FacesException
Description copied from interface: FacesComponent
Perform component initialization before its children and facets are added.

Specified by:
initBeforeContents in interface FacesComponent
Throws:
javax.faces.FacesException

buildContents

public void buildContents(javax.faces.context.FacesContext context,
                          FacesComponentBuilder builder)
                   throws javax.faces.FacesException
Description copied from interface: FacesComponent
Build the component children and facets, the default implementation is usually:
builder.buildAll(context, this, true); // includeFacets=true

Specified by:
buildContents in interface FacesComponent
Throws:
javax.faces.FacesException

initAfterContents

public void initAfterContents(javax.faces.context.FacesContext context)
                       throws javax.faces.FacesException
Description copied from interface: FacesComponent
Perform component initialization after it's children and facets are added.

Specified by:
initAfterContents in interface FacesComponent
Throws:
javax.faces.FacesException

broadcast

public void broadcast(javax.faces.event.FacesEvent event)
               throws javax.faces.event.AbortProcessingException
Overrides:
broadcast in class javax.faces.component.UIComponentBase
Throws:
javax.faces.event.AbortProcessingException

encodeChildren

public void encodeChildren(javax.faces.context.FacesContext context)
                    throws java.io.IOException
Overrides:
encodeChildren in class javax.faces.component.UIComponentBase
Throws:
java.io.IOException

processDecodes

public void processDecodes(javax.faces.context.FacesContext context)
Overrides:
processDecodes in class javax.faces.component.UIComponentBase

processUpdates

public void processUpdates(javax.faces.context.FacesContext context)
Overrides:
processUpdates in class javax.faces.component.UIComponentBase

processValidators

public void processValidators(javax.faces.context.FacesContext context)
Overrides:
processValidators in class javax.faces.component.UIComponentBase

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext context)
Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class javax.faces.component.UIComponentBase

restoreState

public void restoreState(javax.faces.context.FacesContext context,
                         java.lang.Object state)
Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class javax.faces.component.UIComponentBase

getDataModel

public javax.faces.model.DataModel getDataModel()
Specified by:
getDataModel in interface FacesDataIterator

getDir

public java.lang.String getDir()
Returns:
Returns the direction of the text, LTR or RTL.

setDir

public void setDir(java.lang.String dir)