Saritha
Saritha

Reputation: 181

GWT celltable Simple pager Next and previous buttons

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.

Upvotes: 0

Views: 2393

Answers (2)

Prasanth Np
Prasanth Np

Reputation: 175

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.

Upvotes: 0

Thomas Broyer
Thomas Broyer

Reputation: 64541

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

Upvotes: 1

Related Questions