I intend to create a cell table that show info about contacts from the DB. the table i'm about to display has alot of rows.
Currently I managed to display the data with ease. my only problem is, when i change a page in my pager. gwt sends a request for the data again and again, even though i already requested these pages before!
how can i make the client side caching ?
p.s here is a piece of code of the onRangeChanged:
AsyncDataProvider<Contact> provider = new AsyncDataProvider<Contact>() {
@Override
protected void onRangeChanged(HasData<Contact> display) {
int start = display.getVisibleRange().getStart();
int end = start + display.getVisibleRange().getLength();
end = end >= DBHelper.size() ? DBHelper.size() : end;
List<Contact> sub = DBHelper.get(start, end);
updateRowData(start, sub);
}
};
EDIT:
Churro suggested that i will create a helper class (like DBHelper) that will cache some of the results and thats how i will skip a db access. Thats not what I intended, i indended to have a cache on the client side, the helper class still not gonna save me a client -> server call.