Why CellList with ButtonCell column controled by cellListDataProvider behave bizarrely? is it a Gwt bug?

StackOverflow https://stackoverflow.com/questions/21694315

  •  09-10-2022
  •  | 
  •  

Question

I am using Gwt 2.5, i got this very simple code:

ButtonCell buttonCell=new ButtonCell();
CellList<String> cellList = new CellList<String>(buttonCell);
ListDataProvider<String> cellListDataProvider = new ListDataProvider<String>();
List<String> data = cellListDataProvider.getList();
for (int i = 1; i < 12; i++) {

  data.add( String.valueOf(i));
}
cellListDataProvider.addDataDisplay(cellList);
SimplePager pager=new SimplePager();
pager.setDisplay(cellList);
pager.setPageSize(3);

Ok, now i ran, at the beginning it shows:

1
2
3

When i click 1 or 2 or 3 it doesn't jump to next page, that is good no problem

Then i click nextPage, it shows:

4
5
6

Now I click 4 then nothing happened but if i click 5 or 6 then it automatically jumps to the next page to display though I did not click the nextpgae in pager:

7
8
9

So what is wrong with that?

If i change ButtonCell to TextCell, then there is no problem at all.

Was it helpful?

Solution

The issue is due to DefaultKeyboardSelectionHandler.Check execution of that handler. You can fix your issue by disabling KeyboardSelectionPolicy of your CellList

cellList.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top