gwtpaginationsimplepager

Display SimplePager Pagination menu both at the top and bottom of the data


I have some data that I'm displaying in a CellTable which is inside a SimplePager. The pagination navigation options are shown in the bottom, I was wondering if it would be possible to show these on the top as well as the bottom of the data.

I want to do this because depending on the browser size, the user may not be able to see the controls. I want the navigation controls to show both before and after the table data.


Solution

  • Yes, just add two pagers:

    final AbstractPager pager = new SimplePager();
    pager.setDisplay(cellTable);
    contentPanel.add(pager);
    
    contentPanel.add(cellTable);
    
    final AbstractPager pager2 = new SimplePager();
    pager2.setDisplay(cellTable);
    contentPanel.add(pager2);