Hi all,
I am currently developing a webapp using Click 2.1.0. Anyway, according to
my project reqs, there are pages that needs to display data in a pagination
way. And i've had click examples "large dataset demo" implemented in my
project.
So, when i didn't use "DataProvider" class as a data adapter, it works fine
when the amount of retrieved data is less than the table's pageSize.
The problem is, when i used the "DataProvider" to perform pagination and the
amount of retrieved data is less than the table's pageSize, the
IndexOutOfBoundsException is thrown by the page when rendering the page. For
example :
<code>
public ProfilePage() {
...
table.setPageSize(10);
table.setSortable(true);
table.setSorted(true);
...
}
@Override
public void onRender() {
log.debug("# Rendering Profile Page...");
if (hasPreservedState()) {
DataProvider dataProvider = new DataProvider(table,
getMemberUsersRecordCount());
table.setRowList(dataProvider);
List<MemberUsers> memberUsersList = getMemberUsersList(); // e.g.
only
5 records
dataProvider.addAll(memberUsersList);
}
}
</code>
The method 'getMemberUsersRecordCount()' is returning value of '5', so when
retrieving the data, method 'getMemberUsersList()' only returning 5 records.
Is there anyone ever having the same problem? Or is there any posting from
another user?
Thanks.
--
View this message in context:
http://n2.nabble.com/Table-throws-exception-when-the-amount-of-retrieved-data-is-less-than-its-page-size-tp4672850p4672850.html
Sent from the click-user mailing list archive at Nabble.com.