Home » tapestry-src-5.0.19 » org.apache.tapestry5.grid » [javadoc | source]
public interface: GridDataSource [javadoc | source]

All Known Implementing Classes:
    CachingDataSource, NullDataSource, CollectionGridDataSource, HibernateGridDataSource

Defines how a org.apache.tapestry5.corelib.components.Grid component (and its sub-components) gain access to the row data that is displayed on the page. In many cases, this is just a wrapper around a simple List, but the abstractions exist to support access to a large data set that is accessible in sections.
Method from org.apache.tapestry5.grid.GridDataSource Summary:
getAvailableRows,   getRowType,   getRowValue,   prepare
Method from org.apache.tapestry5.grid.GridDataSource Detail:
 public int getAvailableRows()
    Returns the number of rows available in the data source.
 public Class getRowType()
 public Object getRowValue(int index)
    Returns the row value at the provided index. This method will be invoked in sequential order. In rare instances, #getAvailableRows() may return a different number of rows than are actually available (i.e., the database was changed between calls to #getAvailableRows() and the call to #prepare(int, int, java.util.List) ). In that case, this method should return null for any out-of-range indexes.
 public  void prepare(int startIndex,
    int endIndex,
    List<SortConstraint> sortConstraints)
    Invoked to allow the source to prepare to present values. This gives the source a chance to pre-fetch data (when appropriate) and informs the source of the desired sort order. Sorting comes first, then extraction by range.