Search code examples
gwtasynchronouspagerdataprovidercelltable

Asynchronous DataProvider, CellTable, Pager "Last page Button"


I'm using a CellTable with a Page and an Asynchronous DataProvider. Everthing works fine expect, the "last Page" button of the page is disabled. This may be because of the Asynchronous DataProvider, could deliver additional data, and therefore doesn't know how many records he will have and what the last page is. However I know when the data delivery is finished, so then I could display the last page.

How can I tell the Asynchronous DataProvider, that there is no more data and he should display the last page Button?

BR, Stefan


Solution

  • I had the same problem, using a SimplePager with uiBinder. The default constructor for SimplePager shows a forward button, not a last page one...

    I then use @UiField(provided=true) for the SimplePager, and use the following constructor:

    pager = new SimplePager(TextLocation.LEFT, (Resources) GWT.create(SimplePager.Resources.class), false, 0, true);
    

    which match:

    public SimplePager(TextLocation location,
      Resources resources, boolean showFastForwardButton,
      final int fastForwardPages, boolean showLastPageButton)