]> source.dussan.org Git - vaadin-framework.git/commitdiff
Reapply DataGenerators when container changes (#19357, #19359)
authorTeemu Suo-Anttila <teemusa@vaadin.com>
Fri, 11 Dec 2015 08:58:06 +0000 (10:58 +0200)
committerVaadin Code Review <review@vaadin.com>
Mon, 14 Dec 2015 08:49:16 +0000 (08:49 +0000)
Previously on container change Grid applied only its internal
DataGenerators to the new RpcDataProviderExtension. Now it goes through
all existing Extensions and adds all DataGenerators to the data
provider.

Change-Id: Idbd48e5152867b1d2b7a770741e3ea08aa4299b6

server/src/com/vaadin/ui/Grid.java

index e1c7e894a3a49b1ababc980598969f406f01f57a..cad02a6ea6bd387c9fa66e4d0a4cac08b39b1c41 100644 (file)
@@ -4859,6 +4859,11 @@ public class Grid extends AbstractFocusable implements SelectionNotifier,
             removeExtension(datasourceExtension);
         }
 
+        // Remove old DetailComponentManager
+        if (detailComponentManager != null) {
+            detailComponentManager.remove();
+        }
+
         resetEditor();
 
         datasource = container;
@@ -4893,6 +4898,11 @@ public class Grid extends AbstractFocusable implements SelectionNotifier,
         datasourceExtension = new RpcDataProviderExtension(container);
         datasourceExtension.extend(this);
         datasourceExtension.addDataGenerator(new RowDataGenerator());
+        for (Extension e : getExtensions()) {
+            if (e instanceof DataGenerator) {
+                datasourceExtension.addDataGenerator((DataGenerator) e);
+            }
+        }
 
         detailComponentManager = new DetailComponentManager(this);