I'm trying to implement paging in a CellTable but it's currently showing "1-10 of 10" records instead of "1-10 of 1000" records. I'm not sure where I can update the total record count. My AsyncDataProvider looks like this:
AsyncDataProvider<OutletSearchVO> latestProvider = new AsyncDataProvider<OutletSearchVO>() {
@Override
protected void onRangeChanged(HasData<OutletSearchVO> display) {
final int start = display.getVisibleRange().getStart();
int length = display.getVisibleRange().getLength();
AsyncCallback<List<OutletSearchVO>> callback = new AsyncCallback<List<OutletSearchVO>>() {
@Override
public void onFailure(Throwable caught) {
Window.alert(caught.getMessage());
}
@Override
public void onSuccess(List<OutletSearchVO> result) {
updateRowData(start, result);
}
};
// The remote service that should be implemented
service.getOutletPage(start, length, callback);
}
};
The SQL I'm using to grab the records is similar to this:
SELECT *
FROM (SELECT outlet_id,
outlet_name,
image,
ROWNUM rn
FROM ( SELECT outlet_id outlet_id,
account_name outlet_name,
image_score image,
FROM outlets)
ORDER BY OOI.created_on DESC, OOI.account_name))
WHERE rn > ? AND rn < ?
The question marks are replaced by the start and end range in a prepared statement.