Grid Data Sources

By providing your own GridDataSource you can take control of how the data is retrieved,
In this example we have provided a GridDataSource that is "paged", ie. it retrieves only the Persons needed for the selected page and no more.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- We need a doctype to allow us to use special characters like &nbsp;
We use a "strict" DTD to make IE follow the alignment rules. -->
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd">
<body class="container">
<h3>Grid Data Sources</h3>
By providing your own GridDataSource you can take control of how the data is retrieved,<br/>
In this example we have provided a GridDataSource that is "paged", ie. it retrieves only the Persons needed for the selected page and no more.
<div class="eg">
<t:grid source="persons" rowsPerPage="4" pagerPosition="top"/>
</div>
References:
<a href="http://tapestry.apache.org/5.4/apidocs/org/apache/tapestry5/corelib/components/Grid.html">Grid</a>,
<a href="http://tapestry.apache.org/5.4/apidocs/org/apache/tapestry5/grid/GridDataSource.html">GridDataSource</a>.<br/><br/>
<t:pagelink page="Index">Home</t:pagelink><br/><br/>
The source for @EJB is shown in the @EJB example.<br/><br/>
<t:tabgroup>
<t:sourcecodetab src="/web/src/main/java/jumpstart/web/pages/examples/tables/GridDataSources.tml"/>
<t:sourcecodetab src="/web/src/main/java/jumpstart/web/pages/examples/tables/GridDataSources.java"/>
<t:sourcecodetab src="/web/src/main/resources/META-INF/assets/css/examples/plain.css"/>
<t:sourcecodetab src="/web/src/main/java/jumpstart/web/models/examples/tables/PersonPagedDataSource.java"/>
<t:sourcecodetab src="/business/src/main/java/jumpstart/util/query/SortCriterion.java"/>
<t:sourcecodetab src="/business/src/main/java/jumpstart/util/query/SortDirection.java"/>
<t:sourcecodetab src="/business/src/main/java/jumpstart/business/domain/person/PersonFinderService.java"/>
<t:sourcecodetab src="/business/src/main/java/jumpstart/business/domain/person/Person.java"/>
<t:sourcecodetab src="/business/src/main/java/jumpstart/business/domain/person/Regions.java"/>
</t:tabgroup>
</body>
</html>