nikhil
nikhil

Reputation: 9385

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.

Upvotes: 2

Views: 340

Answers (2)

bNd
bNd

Reputation: 7630

The pager shows on top if you add pager before adding celltable in layout.

         CellTable table=new CellTable();
         VerticalPanel containerPanel = new VerticalPanel();
         SimplePager pager1 = new SimplePager(TextLocation.CENTER);
         containerPanel.add(pager);
         containerPanel.add(table);
         SimplePager pager2 = new SimplePager(TextLocation.CENTER)
         containerPanel.add(pager2)

Thus, you have to create two pager and add celltable in between of those.

Upvotes: 1

Chris Lercher
Chris Lercher

Reputation: 37778

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);

Upvotes: 4

Related Questions