Vaadin Version: 8.7.1
Browser: Chrome 73.0.3683.86
Web container: Payara Server 4.1.2.181 #badassfish (build 220)
Description: A user-triggered sorting of a simple column calls the dataprovider too often. This creates unnecessary traffic. Possible origin could be the DataCommunicator.
List<Integer> data = new ArrayList<>();
data.add(0);
data.add(1);
data.add(2);
Grid<Integer> grid = new Grid<>();
grid.addSortListener(event -> {
System.out.println("ON SORT " + event.getComponent().getCaption() + " - " + event.getSortOrder().toString());
});
grid.addColumn(Integer::valueOf).setCaption("ID").setId("id").setSortable(true).setSortProperty("id");
grid.setDataProvider(DataProvider.fromCallbacks(query ->{
System.out.println("FETCH");
if(query.getSortOrders().size() > 0) {
System.out.println("SORT BY " + query.getSortOrders().get(0).getSorted());
}
return data.stream();
}, query -> {
System.out.println("SIZE");
if(query.getSortOrders().size() > 0) {
System.out.println("SORT BY " + query.getSortOrders().get(0).getSorted());
}
return data.size();
}));
Expectation:
Actual behavior:
Log:
SIZE
FETCH
SIZE
SIZE
FETCH - SORT BY id
SIZE
ON SORT null - [com.vaadin.data.provider.GridSortOrder@66ad843d]]
FETCH - SORT BY id
Issue not existent in Vaadin Flow.
Same problem, Vaadin version 8.8.0. This makes back-end backed grid unusable.
Vaadin version 8.8.0, causes grid to be unusable.
I too would like to see this issue fixed as it results in very slow loading of data in the grid component
Please investigate on that issue, we also have the feeling that the grid is very slow when a user-triggered sorting is called
Most helpful comment
Same problem, Vaadin version 8.8.0. This makes back-end backed grid unusable.