]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix Grid unnecessarily cleaning up stored property information (#15482)
authorTeemu Suo-Anttila <teemusa@vaadin.com>
Tue, 30 Dec 2014 08:35:38 +0000 (10:35 +0200)
committerLeif Åstrand <leif@vaadin.com>
Wed, 31 Dec 2014 12:23:16 +0000 (12:23 +0000)
Change-Id: Id77e9101dec77924eb19c19c2cf34702db4d9f6a

server/src/com/vaadin/ui/Grid.java
server/tests/src/com/vaadin/tests/server/component/grid/GridColumnAddingAndRemovingTest.java

index 3d203296d79a1f1841de7203db942df0ea448a1b..0f6912be1adf427e7a5f7411ee7e57614a1a9283 100644 (file)
@@ -2810,7 +2810,6 @@ public class Grid extends AbstractComponent implements SelectionNotifier,
             removeExtension(datasourceExtension);
         }
 
-        columnKeys.removeAll();
         datasource = container;
 
         resetEditor();
index f401fba1e31f116fde225a05d8902f2a48eeca94..97f0355b4bf2d0010d153b2e9da50200e1f4d081 100644 (file)
@@ -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",