-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
// common grid with public setSelectionModel method
CustomGrid g = new CustomGrid();
g.setItems("text1", "text2");
g.addColumn(c -> c).setSortable(true);
TableSelectionModel<String> model = new TableSelectionModel<>();
model.setMode(TableSelectionState.TableSelectionMode.SHIFT);
model.setSelectAllCheckBoxVisibility(SelectAllCheckBoxVisibility.HIDDEN);
g.setSelectionModel(model);
Crashes when selecting an item, because MultiSelectionModelImpl#verifyUserCanSelectAll throws an IllegalStateException on selectAll/deselectAll from client.
Using SelectAllCheckBoxVisibility.VISIBLE does not work properly with Vaadin 8.5.1, because TableSelectionModelConnector#initSelectionModel creates a common MultiSelectionModel and overwrites it with a CustomSelectionModel.
The problem is, that com.vaadin.client.widgets.Grid#setSelectColumnRenderer initially creates a HeaderClickHandler.
If you click on the first column for sorting, all items are selected.
Fix is quite simple:
do not overwrite initSelectionModel() in TableSelectionModelConnector. Overwrite createSelectionModel()
Metadata
Metadata
Assignees
Labels
No labels