How to get the total number of rows for GWT CellTable's pagination

I am trying to implement paging in CellTable, but currently it displays "1-10 out of 10" entries instead of "1-10 out of 1000" entries. I am not sure where I can update the total number of records. 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 use to capture records is similar to the following:

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 < ?    

Question marks are replaced by the start and end ranges in the prepared statement.

+3
source share
1 answer

updateRowCount AsyncDataProvider ( , updateRowData), , (, , , , a true false updateRowCount).

, updateRowCount onRangeChange, , , .

+4

All Articles