I have the following code
taskDataProvider = new ListDataProvider<TaskHeader>();
taskDataProvider.addDataDisplay(taskTable);
ListHandler<TaskHeader> columnSortHandler = new ListHandler<TaskHeader>(
taskDataProvider.getList());
taskTable.addColumnSortHandler(columnSortHandler);
//Some other code that modifies the list in taskDataProvider
When I click on the column header the ColumnSortEvent is fired but upon inspection I can see that the list in columnSortHandler is empty. Any modifications made to the taskDataProvider list have not been reflected in columnSortHandler. Am I missing something?
The example here seems to be exactly what you are looking for.
From what you’re showing of your code, I would say you are missing the comparator
Also, when adding or removing data to your dataProvider, make sure you do not set a new list but add or remove data instead. Otherwise your dataProvider and listHandler will not be working with the same list ..
Don’t :
Do: