diff options
author | Anna Koskinen <Ansku@users.noreply.github.com> | 2020-05-15 14:25:02 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-15 14:25:02 +0300 |
commit | 89fd72edaee18fd8549e105270d66142b1745d2c (patch) | |
tree | 6c51c2dbe7ba40f47e54f97ae3b98dd658d3a08c /uitest/src/main/java | |
parent | 1f709b081c9954e6c9b05d616918f394f2328531 (diff) | |
download | vaadin-framework-89fd72edaee18fd8549e105270d66142b1745d2c.tar.gz vaadin-framework-89fd72edaee18fd8549e105270d66142b1745d2c.zip |
Fix to compatibility Grid sorting after removing multi-select. (#12012)
Adapted from V7 fix #10999
Diffstat (limited to 'uitest/src/main/java')
-rw-r--r-- | uitest/src/main/java/com/vaadin/tests/components/grid/CompatibilityGridToggleMultiSelectSort.java | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/CompatibilityGridToggleMultiSelectSort.java b/uitest/src/main/java/com/vaadin/tests/components/grid/CompatibilityGridToggleMultiSelectSort.java new file mode 100644 index 0000000000..f62276de2c --- /dev/null +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/CompatibilityGridToggleMultiSelectSort.java @@ -0,0 +1,35 @@ +package com.vaadin.tests.components.grid; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.tests.minitutorials.v7_4.GridExampleHelper; +import com.vaadin.ui.Button; +import com.vaadin.v7.ui.Grid; +import com.vaadin.v7.ui.Grid.MultiSelectionModel; +import com.vaadin.v7.ui.Grid.SelectionMode; + +public class CompatibilityGridToggleMultiSelectSort extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + // container with at least 100 rows + final Grid grid = new Grid(GridExampleHelper.createContainer()); + grid.setSelectionMode(SelectionMode.MULTI); + addComponent(grid); + + Button button = new Button("Toggle multi-select", e -> { + if (grid.getSelectionModel() instanceof MultiSelectionModel) { + grid.setSelectionMode(SelectionMode.SINGLE); + } else { + grid.setSelectionMode(SelectionMode.MULTI); + } + }); + addComponent(button); + } + + @Override + protected String getTestDescription() { + return "Toggling multi-select off should not break sorting " + + "first column to both directions."; + } +} |