diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2014-12-29 15:25:52 +0200 |
---|---|---|
committer | Teemu Suo-Anttila <teemusa@vaadin.com> | 2015-01-02 15:43:45 +0200 |
commit | ad1252def1f1fe8d55edd711d6031a2db3985479 (patch) | |
tree | 31086af66b0a9620d271f23cc03a0a7f4abe567e | |
parent | 40582761f7c23b016155e173d1cb3bd73b3086fb (diff) | |
download | vaadin-framework-ad1252def1f1fe8d55edd711d6031a2db3985479.tar.gz vaadin-framework-ad1252def1f1fe8d55edd711d6031a2db3985479.zip |
Fix adding rows to visible range of Grid (#15476)
Change-Id: I53a40d927d273a292c8ac845b385c156b9fb901a
4 files changed, 10 insertions, 3 deletions
diff --git a/server/src/com/vaadin/data/RpcDataProviderExtension.java b/server/src/com/vaadin/data/RpcDataProviderExtension.java index a24ee9acd7..2b3e00e6f0 100644 --- a/server/src/com/vaadin/data/RpcDataProviderExtension.java +++ b/server/src/com/vaadin/data/RpcDataProviderExtension.java @@ -508,7 +508,7 @@ public class RpcDataProviderExtension extends AbstractExtension { activeRange.getEnd(), count); removeValueChangeListeners(deprecatedRange); - final Range freshRange = Range.between(firstIndex, count); + final Range freshRange = Range.withLength(firstIndex, count); addValueChangeListeners(freshRange); } else { // out of view, noop diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java index 99b7ef21c7..20b6a3c418 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java @@ -787,7 +787,7 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { createClickAction("Add first row", "Body rows", newRowCommand, null); - createClickAction("Add second row", "Body rows", new NewRowCommand(1), + createClickAction("Add third row", "Body rows", new NewRowCommand(2), null); createClickAction("Remove first row", "Body rows", diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridCellFocusAdjustmentTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridCellFocusAdjustmentTest.java index ef6d6bfa82..0c26ceb5c9 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridCellFocusAdjustmentTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridCellFocusAdjustmentTest.java @@ -78,7 +78,7 @@ public class GridCellFocusAdjustmentTest extends GridBasicFeaturesTest { assertTrue("Body 0,0 should've gotten focus", getGridElement().getCell(0, 0).isFocused()); - selectMenuPath("Component", "Body rows", "Add second row"); + selectMenuPath("Component", "Body rows", "Add third row"); assertTrue("Body 0,0 should've remained focused", getGridElement() .getCell(0, 0).isFocused()); } diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridStructureTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridStructureTest.java index 97a4fb8f4a..08f903b3fe 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridStructureTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridStructureTest.java @@ -475,4 +475,11 @@ public class GridStructureTest extends GridBasicFeaturesTest { assertFalse("Exception occurred when reloading page", isElementPresent(NotificationElement.class)); } + + @Test + public void testAddThirdRowToGrid() { + openTestURL(); + selectMenuPath("Component", "Body rows", "Add third row"); + assertFalse(logContainsText("Exception occured")); + } } |