From a7eec5507effc87f6b3b91384ee701ffb4e163a3 Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Tue, 24 Feb 2015 13:07:09 +0200 Subject: [PATCH] Fix adding and modifying multiple rows in Grid (#16905) Change-Id: Ib3ae8d305f44a78c9bd6f4539ca9cee2a487d269 --- .../com/vaadin/data/RpcDataProviderExtension.java | 3 ++- .../basicfeatures/server/GridRowAddRemoveTest.java | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/server/src/com/vaadin/data/RpcDataProviderExtension.java b/server/src/com/vaadin/data/RpcDataProviderExtension.java index 3acd12d863..991cb0537d 100644 --- a/server/src/com/vaadin/data/RpcDataProviderExtension.java +++ b/server/src/com/vaadin/data/RpcDataProviderExtension.java @@ -21,6 +21,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; +import java.util.LinkedHashSet; import java.util.List; import java.util.Locale; import java.util.Map; @@ -715,7 +716,7 @@ public class RpcDataProviderExtension extends AbstractExtension { private CellReference cellReference; /** Set of updated item ids */ - private Set updatedItemIds = new HashSet(); + private Set updatedItemIds = new LinkedHashSet(); /** * Queued RPC calls for adding and removing rows. Queue will be handled in diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridRowAddRemoveTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridRowAddRemoveTest.java index 8535efb9ef..b7c33519dd 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridRowAddRemoveTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridRowAddRemoveTest.java @@ -18,12 +18,14 @@ package com.vaadin.tests.components.grid.basicfeatures.server; import org.junit.Assert; import org.junit.Test; +import com.vaadin.testbench.elements.NotificationElement; import com.vaadin.tests.components.grid.basicfeatures.GridBasicFeaturesTest; public class GridRowAddRemoveTest extends GridBasicFeaturesTest { @Test public void addRows_loadAllAtOnce() { + setDebug(true); openTestURL(); selectMenuPath("Settings", "Clear log"); @@ -54,4 +56,16 @@ public class GridRowAddRemoveTest extends GridBasicFeaturesTest { "All newly required rows should be fetched in the same round trip.", logContainsText("Requested items 37 - 55")); } + + @Test + public void testAdd18Rows() { + setDebug(true); + openTestURL(); + + selectMenuPath("Settings", "Clear log"); + selectMenuPath("Component", "Body rows", "Add 18 rows"); + + Assert.assertFalse("An error notification is present.", + isElementPresent(NotificationElement.class)); + } } -- 2.39.5