Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SelectAllCheckBoxVisibility.HIDDEN is not possible #30

Open
yoshie82 opened this issue Aug 14, 2018 · 0 comments
Open

SelectAllCheckBoxVisibility.HIDDEN is not possible #30

yoshie82 opened this issue Aug 14, 2018 · 0 comments

Comments

@yoshie82
Copy link

        // 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()

alexandru78 added a commit to antea/GridExtensionPack that referenced this issue Aug 8, 2019
… column doesn't provoke selection/deselection of all rows.
alexandru78 added a commit to alexandru78/GridExtensionPack that referenced this issue Aug 8, 2019
solves tsuoanttila#30 issue - sorting by first column doesn't provoke selection/deselection of all rows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant