Hello,
i have a listShuttle with large lists (over 1000 entries), which causes very long loading times or in case of the internet explorer even to crash completely. So i decided to implement a paging-functionality to both lists and limit the entries displayed per page to 250.
I manipulated the getter for the lists like that.
public List<UserVO> getSourceList() {
ArrayList<UserVO> allUsers = new ArrayList<UserVO>();
allUsers = getAllUsersWithoutTargetValues();
if (allUsers.size() > MAX_LIST_ENTRIES) {
setSource_paging(true);
setSource_max_pages(allUsers.size() / MAX_LIST_ENTRIES);
int rest = allUsers.size() % MAX_LIST_ENTRIES;
if (rest != 0)
setSource_max_pages(this.source_max_pages + 1);
if (currentPage != source_max_pages && rest != 0) {
sourceList = allUsers.subList((currentPage - 1) * MAX_LIST_ENTRIES, currentPage * MAX_LIST_ENTRIES);
} else {
sourceList = allUsers.subList((currentPage - 1) * MAX_LIST_ENTRIES, (currentPage) * MAX_LIST_ENTRIES + rest);
}
} else {
setSource_paging(false);
sourceList = allUsers;
}
return sourceList;
}