]> source.dussan.org Git - gwtquery.git/commitdiff
Support adding widgets to widgets which not override Panel.add method like tables
authorManuel Carrasco Moñino <manuel.carrasco.m@gmail.com>
Tue, 19 Mar 2013 22:10:01 +0000 (23:10 +0100)
committerManuel Carrasco Moñino <manuel.carrasco.m@gmail.com>
Tue, 19 Mar 2013 22:10:01 +0000 (23:10 +0100)
gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/WidgetsUtils.java

index 3c82a6182d9087d4c090bc532f3329e70b92a5f0..408d13368794a5d9b0d3059201ce81f9fda340f3 100644 (file)
@@ -203,7 +203,12 @@ public class WidgetsUtils {
        } else if (firstParentWidget instanceof HasOneWidget) {
          ((HasOneWidget)firstParentWidget).setWidget(widget);
        } else if (firstParentWidget instanceof HasWidgets) {
-         ((HasWidgets)firstParentWidget).add(widget);
+         try {
+           ((HasWidgets)firstParentWidget).add(widget);
+         } catch (UnsupportedOperationException e) {
+           // Some widgets like 'table' has no implementation of 'add(widget)'
+           widgetSetParent(widget, firstParentWidget);
+         }
        } else {
          widgetSetParent(widget, firstParentWidget);
        }