* is specified the new row list will be populated from the data provider.
*
* @return a new table row list
*/
protected List createRowList() {
DataProvider dp = getDataProvider();
List<Object> rowList = null;
if (dp != null) {
boolean isPaginating = false;
if (dp instanceof PagingDataProvider) {
isPaginating = true;
}
if (isPaginating) {
// rowCount is provided by the paging data provider. Its
// important to set the rowCount *before* invoking dp.getData
// since the getData implementation could have a dependency
// on the methods getFirstRow, getLastRow etc all of which
// depends on the rowCount value
this.rowCount = ((PagingDataProvider) dp).size();
// paginated datasets cannot be sorted by the table since it
// has access to only a limited number of rows. The dataset has
// to be sorted by a database or other means. Set the sorted
// property to true indicating that the data is already in a
// sorted state
setSorted(true);
}
Iterable iterableData = dp.getData();
// If dataProvider returns a list, use that as the rowList
if (iterableData instanceof List) {
rowList = (List) iterableData;