I am using AsyncDataProvider to generate the CellTable as mentioned in this example. http://www.mytechtip.com/2010/11/gwt-celltable-example-using_8168.html
I am using second approach where you call remote service to fetch the records as mentioned here.
// Associate an async data provider to the table
AsyncDataProvider<Contact> provider = new AsyncDataProvider<Contact>() {
@Override
protected void onRangeChanged(HasData<Contact> display) {
final int start = display.getVisibleRange().getStart();
int length = display.getVisibleRange().getLength();
AsyncCallback<List<Contact>> callback = new AsyncCallback<List<Contact>>() {
@Override
public void onFailure(Throwable caught) {
Window.alert(caught.getMessage());
}
@Override
public void onSuccess(List<Contact> result) {
updateRowData(start, result);
}
};
// The remote service that should be implemented
remoteService.fetchPage(start, length, callback);
}
}
In my remoteService.fetchPage() method return 1000 record and I am not sure how to display 50 record on the page.