com.ibm.xsp.component
Class UIDataIterator

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by com.ibm.xsp.component.UIDataIterator
All Implemented Interfaces:
FacesAjaxComponent, FacesDataIterator, FacesRefreshableComponent, FacesRowIndex, FacesDefinitionClass, javax.faces.component.NamingContainer, javax.faces.component.StateHolder
Direct Known Subclasses:
XspDataIterator

public class UIDataIterator
extends javax.faces.component.UIComponentBase
implements javax.faces.component.NamingContainer, FacesDataIterator, FacesDefinitionClass, FacesRefreshableComponent, FacesAjaxComponent

Iterates over a data set with its children creating only one instance of the children. 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 AJAX_GETROWS
           
static java.lang.String COMPONENT_FAMILY
           
static java.lang.String COMPONENT_TYPE
           
static int DEFAULT_ROWS_PER_PAGE
          This is a default value that will be applied if "rows" is not set or is less than 1
 
Fields inherited from class javax.faces.component.UIComponentBase
EMPTY_ITERATOR
 
Fields inherited from class javax.faces.component.UIComponent
_xspStateId
 
Constructor Summary
UIDataIterator()
           
 
Method Summary
 void _xspCleanTransientData()
           
 void broadcast(javax.faces.event.FacesEvent event)
           
protected  java.lang.String computeDataModelKey()
          Computes Data model key based on parent DataIterators.
protected  javax.faces.model.DataModel createDataModel()
          Helper method for creating the data model based on the components value.
 void encodeBegin(javax.faces.context.FacesContext context)
           
 void encodeChildren(javax.faces.context.FacesContext context)
           
 void encodeEnd(javax.faces.context.FacesContext context)
           
 java.lang.String getAjaxUrl(javax.faces.context.FacesContext context, java.lang.String verb)
           
 java.lang.String getAjaxUrl(java.lang.String verb)
           
 java.lang.String getClientId(javax.faces.context.FacesContext context)
           
 javax.faces.model.DataModel getDataModel()
          Helper method to return the current DataModel instance
protected  DataSource getDataSource()
           
 java.lang.String getDir()
           
 java.lang.String getFamily()
           
 int getFirst()
           
 int getIndex()
          Deprecated. Use getRowIndex() instead, to match the UIData class and the FacesDataIterator interface.
 java.lang.String getIndexVar()
           Return the value of the indexVar property.
 java.lang.Class<? extends javax.faces.component.UIComponent> getJavaClass(com.ibm.xsp.page.parse.types.FacesInstance instance)
          The class returned must be a non-abstract UIComponent class, with a public, zero-arguments constructor.
 java.lang.String getNonChildClientId(javax.faces.context.FacesContext context)
           
 boolean getRendersChildren()
           
 int getRowCount()
          Return the number of rows in the underlying data model.
 int getRowCount(int maxCount)
           
 int getRowIndex()
           
 int getRows()
           
 java.lang.Object getValue()
           
 java.lang.String getVar()
           
 boolean gotoFirstPage()
          Go to the first page in the data control.
 boolean gotoLastPage()
          Go to the last page in the data control.
 boolean gotoNextPage()
          Go to the next page in the data control.
 boolean gotoPage(int page)
          Go to the specified page in the data control.
 boolean gotoPreviousPage()
          Go to the previous page in the data control.
 boolean gotoRow(int row)
          Go to the specified row in the data control.
 boolean handles(javax.faces.context.FacesContext context)
          Check if the pathinfo request is for this target ajax component
 boolean invokeOnComponent(javax.faces.context.FacesContext context, java.lang.String clientId, javax.faces.component.ContextCallback callback)
           
protected  boolean isNestedInUIIterator()
           
 boolean isRemoveRepeat()
          Return the value of the removeRepeat property.
 boolean isRepeatControls()
           Return the value of the repeatControls property.
 boolean isRowAvailable()
           
protected  void processAjaxGetRows(javax.faces.context.FacesContext context)
           
 void processAjaxRequest(javax.faces.context.FacesContext context)
          Process the request for this target ajax component
 void processDecodes(javax.faces.context.FacesContext context)
           
 void processUpdates(javax.faces.context.FacesContext context)
           
 void processValidators(javax.faces.context.FacesContext context)
           
protected  java.util.List<DataPublisher.ShadowedObject> publishControlData(javax.faces.context.FacesContext context)
           
protected  void pushVars(javax.faces.context.FacesContext context, javax.faces.model.DataModel model)
           
 void queueEvent(javax.faces.event.FacesEvent event)
           
protected  void resetDataModel()
          resets data model
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object _state)
           
protected  void restoreValueHolderState(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
protected  void revokeControlData(java.util.List<DataPublisher.ShadowedObject> shadowedObjects, javax.faces.context.FacesContext context)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
protected  void saveValueHolderState(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
 void setDir(java.lang.String dir)
           
 void setFirst(int first)
           
 void setIndex(int index)
          Deprecated. use setRowIndex(int) instead, to match the UIData class
 void setIndexVar(java.lang.String indexVar)
           Set the value of the indexVar property.
 void setRemoveRepeat(boolean remove)
          Set the value of the removeRepeat property.
 void setRepeatControls(boolean repeatControls)
           Set the value of the repeatControls property.
 void setRowIndex(int index)
           
 void setRows(int rows)
           
 void setValue(java.lang.Object o)
           
 void setValueBinding(java.lang.String name, javax.faces.el.ValueBinding binding)
           
 void setVar(java.lang.String var)
           
 boolean visitTree(javax.faces.component.visit.VisitContext context, javax.faces.component.visit.VisitCallback callback)
           
 
Methods inherited from class javax.faces.component.UIComponentBase
_xspGetReadOnlyObj, _xspGetRendererData, _xspRemoveReadOnlyObj, _xspRemoveRendererData, _xspSetIdUnchecked, _xspSetReadOnlyObj, _xspSetRendererData, addFacesListener, decode, findComponent, getAttributes, getChildCount, getChildren, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getValueBinding, isRendered, isTransient, processRestoreState, processSaveState, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
 
Methods inherited from class javax.faces.component.UIComponent
_xspGetStateId, _xspGetStateMap, _xspRestoreAttribute, _xspRestoreState, _xspSaveState, isVisitable, markInitialState, setControlState
 
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

DEFAULT_ROWS_PER_PAGE

public static final int DEFAULT_ROWS_PER_PAGE
This is a default value that will be applied if "rows" is not set or is less than 1

See Also:
Constant Field Values

AJAX_GETROWS

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

UIDataIterator

public UIDataIterator()
Method Detail

_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

getJavaClass

public java.lang.Class<? extends javax.faces.component.UIComponent> getJavaClass(com.ibm.xsp.page.parse.types.FacesInstance instance)
Description copied from interface: FacesDefinitionClass
The class returned must be a non-abstract UIComponent class, with a public, zero-arguments constructor.

Note, none of the properties or attributes will have been set on this UIComponent when this method is invoked - only the constructor will have been called. This UIComponent will then be discarded after invoking this method.

The implementation is expected to examine the properties of the tag in the FacesInstance to decide which runtime class to return. (If the implementation always returns the same class, then this mechanism need not be used - instead just declare the tag's java class as being that runtime class)

Specified by:
getJavaClass in interface FacesDefinitionClass
Parameters:
instance - an instance of a tag in an .xsp, where the java class defined for the tag is this UIComponent class.
Returns:

getDataModel

public javax.faces.model.DataModel getDataModel()
Helper method to return the current DataModel instance

Specified by:
getDataModel in interface FacesDataIterator

getDataSource

protected DataSource getDataSource()

createDataModel

protected javax.faces.model.DataModel createDataModel()
Helper method for creating the data model based on the components value.

Returns:

computeDataModelKey

protected java.lang.String computeDataModelKey()
Computes Data model key based on parent DataIterators.

Returns:

resetDataModel

protected void resetDataModel()
resets data model


gotoFirstPage

public boolean gotoFirstPage()
Go to the first page in the data control.

Returns:

gotoPreviousPage

public boolean gotoPreviousPage()
Go to the previous page in the data control.

Returns:

gotoNextPage

public boolean gotoNextPage()
Go to the next page in the data control.

Returns:

gotoLastPage

public boolean gotoLastPage()
Go to the last page in the data control.

Returns:

gotoRow

public boolean gotoRow(int row)
Go to the specified row in the data control.

Returns:

gotoPage

public boolean gotoPage(int page)
Go to the specified page in the data control.

Returns:

getDir

public java.lang.String getDir()

setDir

public void setDir(java.lang.String dir)

getFirst

public int getFirst()
Specified by:
getFirst in interface FacesDataIterator
Returns:
Returns the index of the first row to be process (first row is zero), default is 0.

setFirst

public void setFirst(int first)
Specified by:
setFirst in interface FacesDataIterator
Parameters:
first - Set the index of the first row to be processed, if set to value less than zero it will be set to zero.

getRows

public int getRows()
Specified by:
getRows in interface FacesDataIterator
Returns:
Returns the number of rows to be process starting from the index.

setRows

public void setRows(int rows)
Specified by:
setRows in interface FacesDataIterator
Parameters:
rows - Sets the number of rows to be process starting from the index.

getValue

public java.lang.Object getValue()

setValue

public void setValue(java.lang.Object o)

getIndex

public int getIndex()
Deprecated. Use getRowIndex() instead, to match the UIData class and the FacesDataIterator interface.

Returns:
Returns the rowIndex.

getRowIndex

public int getRowIndex()
Specified by:
getRowIndex in interface FacesDataIterator
Specified by:
getRowIndex in interface FacesRowIndex

setIndex

public void setIndex(int index)
Deprecated. use setRowIndex(int) instead, to match the UIData class

Parameters:
rowIndex - The rowIndex to set.

setRowIndex

public void setRowIndex(int index)
Parameters:
rowIndex - The rowIndex to set.

publishControlData

protected java.util.List<DataPublisher.ShadowedObject> publishControlData(javax.faces.context.FacesContext context)
Parameters:
shadowedObjects - null or list of shadowedObjects
Returns:
shadowedObjects list of shadowedObjects, or Collections.emptyList()

revokeControlData

protected void revokeControlData(java.util.List<DataPublisher.ShadowedObject> shadowedObjects,
                                 javax.faces.context.FacesContext context)

pushVars

protected void pushVars(javax.faces.context.FacesContext context,
                        javax.faces.model.DataModel model)

isRowAvailable

public boolean isRowAvailable()

getIndexVar

public java.lang.String getIndexVar()

Return the value of the indexVar property. Contents:

The variable name under which the row index is made available to children


isRepeatControls

public boolean isRepeatControls()

Return the value of the repeatControls property. Contents:

Boolean flag indicating if mulitple controls are to be created. The repeat has to modes, when repeatControls="false" (default), a single set of child controls are iterated over for each entry in the data model thats to be processed. The second mode is where on inital page creation, multiple sets of controls are created one for each row in the data model.


setIndexVar

public void setIndexVar(java.lang.String indexVar)

Set the value of the indexVar property.


setRepeatControls

public void setRepeatControls(boolean repeatControls)

Set the value of the repeatControls property.


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.


setValueBinding

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

getVar

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

setVar

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

getRendersChildren

public boolean getRendersChildren()
Overrides:
getRendersChildren in class javax.faces.component.UIComponentBase

queueEvent

public void queueEvent(javax.faces.event.FacesEvent event)
Overrides:
queueEvent in class javax.faces.component.UIComponentBase

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

encodeBegin

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

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

encodeEnd

public void encodeEnd(javax.faces.context.FacesContext context)
               throws java.io.IOException
Overrides:
encodeEnd 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

isNestedInUIIterator

protected boolean isNestedInUIIterator()

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.

getRowCount

public int getRowCount(int maxCount)

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

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

saveValueHolderState

protected void saveValueHolderState(javax.faces.context.FacesContext context,
                                    javax.faces.component.UIComponent component)

restoreValueHolderState

protected void restoreValueHolderState(javax.faces.context.FacesContext context,
                                       javax.faces.component.UIComponent component)

invokeOnComponent

public boolean invokeOnComponent(javax.faces.context.FacesContext context,
                                 java.lang.String clientId,
                                 javax.faces.component.ContextCallback callback)
                          throws javax.faces.FacesException
Overrides:
invokeOnComponent in class javax.faces.component.UIComponent
Throws:
javax.faces.FacesException

visitTree

public boolean visitTree(javax.faces.component.visit.VisitContext context,
                         javax.faces.component.visit.VisitCallback callback)
Overrides:
visitTree in class javax.faces.component.UIComponent

getClientId

public java.lang.String getClientId(javax.faces.context.FacesContext context)
Overrides:
getClientId in class javax.faces.component.UIComponentBase

getNonChildClientId

public java.lang.String getNonChildClientId(javax.faces.context.FacesContext context)
Specified by:
getNonChildClientId in interface FacesRefreshableComponent
Returns:

getAjaxUrl

public java.lang.String getAjaxUrl(java.lang.String verb)

getAjaxUrl

public java.lang.String getAjaxUrl(javax.faces.context.FacesContext context,
                                   java.lang.String verb)

handles

public boolean handles(javax.faces.context.FacesContext context)
Description copied from interface: FacesAjaxComponent
Check if the pathinfo request is for this target ajax component

Specified by:
handles in interface FacesAjaxComponent
Returns:
true if request handler

processAjaxRequest

public void processAjaxRequest(javax.faces.context.FacesContext context)
                        throws java.io.IOException
Description copied from interface: FacesAjaxComponent
Process the request for this target ajax component

Specified by:
processAjaxRequest in interface FacesAjaxComponent
Throws:
java.io.IOException

processAjaxGetRows

protected void processAjaxGetRows(javax.faces.context.FacesContext context)
                           throws java.io.IOException
Throws:
java.io.IOException