com.infragistics.faces.shared.component
Class DataRepeater

java.lang.Object
  extended byjavax.faces.component.UIComponent
      extended byjavax.faces.component.UIComponentBase
          extended bycom.infragistics.faces.shared.component.DataRepeater
All Implemented Interfaces:
javax.faces.component.NamingContainer, javax.faces.component.StateHolder
Direct Known Subclasses:
BoxRepeater, DataList

public class DataRepeater
extends javax.faces.component.UIComponentBase
implements javax.faces.component.NamingContainer

This class is the base class for components that can be bound to a DataModel (for instance a grid component).
Children component can refer to a row of the DataModel using the string "DATA_ROW" in EL expressions (ie: ... value="#{DATA_ROW.firstName}" ... ).

Note that bindings of the component and children components are only evaluated when the component is first bound to the DataModel. This avoid unecessary bindings and considerably increase performance of DataBound component.
If needed, bindings can be refreshed at any time by calling the method dataBind().


Field Summary
static java.lang.String COMPONENT_FAMILY
           
static java.lang.String COMPONENT_TYPE
           
static java.lang.String DATA_ROW
           
static java.lang.String RENDERER_TYPE
           
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
DataRepeater()
           
 
Method Summary
 void broadcast(javax.faces.event.FacesEvent event)
           
 void dataBind()
          Binds the component to its data source and evaluate its bindings
 void encodeBegin(javax.faces.context.FacesContext context)
           
 void encodeEnd(javax.faces.context.FacesContext context)
           
 java.lang.String getDataKeyName()
          Returns the name of the field(s) that uniquely identifies each record in the data source.
static java.lang.Object getDataKeyValue(javax.faces.component.UIComponent component)
          Return the DataKeyValue of the DataRow that the specified UIComponent is bound-to.
 javax.faces.model.DataModel getDataSource()
          Returns the data source the component is bound-to.
 java.lang.String getFamily()
           
 java.util.List getTemplateItems()
          Return a list of components to use as template for each row of the data model The list has been previously saved as an attribute under the key TEMPLATE_ITEM
 void processUpdates(javax.faces.context.FacesContext context)
           
 void processValidators(javax.faces.context.FacesContext context)
           
 void queueEvent(javax.faces.event.FacesEvent event)
           
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setDataKeyName(java.lang.String dataKeyName)
          Sets the name of the field(s) that uniquely identify each record in the data source.
 void setDataSource(javax.faces.model.DataModel model)
          Sets the data source this component is bound-to
 void setValueBinding(java.lang.String name, javax.faces.el.ValueBinding binding)
           
 
Methods inherited from class javax.faces.component.UIComponentBase
decode, encodeChildren, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPONENT_FAMILY

public static java.lang.String COMPONENT_FAMILY

COMPONENT_TYPE

public static java.lang.String COMPONENT_TYPE

DATA_ROW

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

RENDERER_TYPE

public static java.lang.String RENDERER_TYPE
Constructor Detail

DataRepeater

public DataRepeater()
Method Detail

getDataKeyValue

public static java.lang.Object getDataKeyValue(javax.faces.component.UIComponent component)
Return the DataKeyValue of the DataRow that the specified UIComponent is bound-to. This method is usually used inside event listeners to get the value of the key that the component is bound-to.


broadcast

public void broadcast(javax.faces.event.FacesEvent event)
               throws javax.faces.event.AbortProcessingException
Throws:
javax.faces.event.AbortProcessingException

dataBind

public void dataBind()
Binds the component to its data source and evaluate its bindings


encodeBegin

public void encodeBegin(javax.faces.context.FacesContext context)
                 throws java.io.IOException
Throws:
java.io.IOException

encodeEnd

public void encodeEnd(javax.faces.context.FacesContext context)
               throws java.io.IOException
Throws:
java.io.IOException

getDataKeyName

public java.lang.String getDataKeyName()
Returns the name of the field(s) that uniquely identifies each record in the data source.

Returns:
the dataKey

getDataSource

public javax.faces.model.DataModel getDataSource()
Returns the data source the component is bound-to.

Returns:
the dataModel DataModel the component is bound-to

getFamily

public java.lang.String getFamily()

getTemplateItems

public java.util.List getTemplateItems()
Return a list of components to use as template for each row of the data model The list has been previously saved as an attribute under the key TEMPLATE_ITEM

Returns:
a List of template items

processUpdates

public void processUpdates(javax.faces.context.FacesContext context)

processValidators

public void processValidators(javax.faces.context.FacesContext context)

queueEvent

public void queueEvent(javax.faces.event.FacesEvent event)

restoreState

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

saveState

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

setDataKeyName

public void setDataKeyName(java.lang.String dataKeyName)
Sets the name of the field(s) that uniquely identify each record in the data source. Primary key can be simple (ie: "employeeID") or composite (ie: "firstName; lastName"). To specify a composite primary key, use semi-colons to separate fields name


setDataSource

public void setDataSource(javax.faces.model.DataModel model)
Sets the data source this component is bound-to

Parameters:
model -

setValueBinding

public void setValueBinding(java.lang.String name,
                            javax.faces.el.ValueBinding binding)