* Because that, we first check the size, asking only for one record (0 to 1). After that the "PageSize" attribute will be set.
*/
@Override
public int size() {
PaginationContext paginationContext = Beans.getReference(PaginationContext.class);
Pagination pagination = paginationContext.getPagination(beanClass, true);
// If size equals 0 then is the first call to container or the table has 0 record.
// Lets minimize the overhead asking only for 1 record.
if (size == 0) {
// Store this list for further use. Lets minimize even more the overhead.
list = handler.handleResultList();
size = pagination.getTotalResults(); // Ok, now we have the real totalResults.
}
return size;
}