aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2014-12-30 10:35:38 +0200
committerLeif Åstrand <leif@vaadin.com>2014-12-31 12:23:16 +0000
commitd298d61416f719037c1c55d635d538d550994ca2 (patch)
tree8827da9e2ccb1dd115aeeebb138e0ca273162fac /server
parent956a7fdaa73ea3850a2f402b5563911e8d81ea39 (diff)
downloadvaadin-framework-d298d61416f719037c1c55d635d538d550994ca2.tar.gz
vaadin-framework-d298d61416f719037c1c55d635d538d550994ca2.zip
Fix Grid unnecessarily cleaning up stored property information (#15482)
Change-Id: Id77e9101dec77924eb19c19c2cf34702db4d9f6a
Diffstat (limited to 'server')
-rw-r--r--server/src/com/vaadin/ui/Grid.java1
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/grid/GridColumnAddingAndRemovingTest.java6
2 files changed, 6 insertions, 1 deletions
diff --git a/server/src/com/vaadin/ui/Grid.java b/server/src/com/vaadin/ui/Grid.java
index 3d203296d7..0f6912be1a 100644
--- a/server/src/com/vaadin/ui/Grid.java
+++ b/server/src/com/vaadin/ui/Grid.java
@@ -2810,7 +2810,6 @@ public class Grid extends AbstractComponent implements SelectionNotifier,
removeExtension(datasourceExtension);
}
- columnKeys.removeAll();
datasource = container;
resetEditor();
diff --git a/server/tests/src/com/vaadin/tests/server/component/grid/GridColumnAddingAndRemovingTest.java b/server/tests/src/com/vaadin/tests/server/component/grid/GridColumnAddingAndRemovingTest.java
index f401fba1e3..97f0355b4b 100644
--- a/server/tests/src/com/vaadin/tests/server/component/grid/GridColumnAddingAndRemovingTest.java
+++ b/server/tests/src/com/vaadin/tests/server/component/grid/GridColumnAddingAndRemovingTest.java
@@ -102,6 +102,12 @@ public class GridColumnAddingAndRemovingTest {
grid.setContainerDataSource(container2);
assertNull("Grid should not have a column for property foo",
grid.getColumn("foo"));
+ assertNotNull("Grid did should have a column for property bar",
+ grid.getColumn("bar"));
+ for (Grid.Column column : grid.getColumns()) {
+ assertNotNull("Grid getColumns returned a null value", column);
+ }
+
grid.removeAllColumns();
grid.addColumn("foo");
assertNotNull("Grid should now have a column for property foo",