0

I am working on a CellTable with a SimplePager. My paging works fine in the sense when i set the page size to be 5 only 5 records are being displayed. My question is that do next and previous buttons come by default or do we have to configure them. I have seen the show case example code and i do not see any external configurations . my SimplePager code is as follows:

//create pager

SimplePager.Resources resources = GWT.create(SimplePager.Resources.class); 
SimplePager simplePager = new SimplePager(TextLocation.CENTER, resources , false, 0, true);
simplePager.setDisplay(cellTableSearchResults);
simplePager.setPageSize(5);

// create data provider
ListDataProvider<GridDTO> dataProvider = new ListDataProvider<GridDTO>();
dataProvider.addDataDisplay(cellTableSearchResults);
dataProvider.setList(components);

Please help.

prayagupa
  • 30,204
  • 14
  • 155
  • 192
Saritha
  • 181
  • 17

2 Answers2

1

SimplePager is a widget containing those buttons. Did you simply forgot to display it?

Thomas Broyer
  • 64,353
  • 7
  • 91
  • 164
  • is there any property which will enable the visibility of those buttons cos they seem to be invisible in my UI.. My code is mentioned above. The grid is being displayed and the 5 rows are being displayed but the buttons are not being displayed. Thanks for teh reply. Please help – Saritha Aug 29 '12 at 11:35
  • My bad... I am new to GWT... I found the solution. I did not add it in the Ui Binder... Thanks Thomas..... Can you tell me how I need to access the next and previous buttons if possible... I mean right now they are disabled. Nothing happens when i click on next when i use the above code.. Dow paging take place automatically i.e. lets say I have 30 records and if i assign pagesize to be 5 will i get 6 pages automatically cos as of now only the control is visible...Please help. Thanks – Saritha Aug 29 '12 at 11:57
  • 1
    If your `components` list contains all 30 items, then yes, it's supposed to Just Work™. `SimplePager` uses the `getVisibleRange` and `getRowCount` of the `CellTable` (through `RangeChangeEvent` and `RowCountChangeEvent` handlers) to update itself. – Thomas Broyer Aug 29 '12 at 12:14
  • I am using UI binder and all the buttons seem disabled for some reason...I will share my UI binder code here. – Saritha Aug 29 '12 at 12:33
0

Set page size to celltable by cellTable.setPageSize(5); Don't set simplepagers page size simplePager.setPageSize(5);

this will split cell table to show 5 rows as visible Items.

Nagama Inamdar
  • 2,851
  • 22
  • 39
  • 48
Prasanth Np
  • 175
  • 6