From 28322dc6b23697f28917839e32ddd390e1348eae Mon Sep 17 00:00:00 2001 From: =?utf8?q?Manuel=20Carrasco=20Mo=C3=B1ino?= Date: Tue, 19 Mar 2013 23:10:01 +0100 Subject: [PATCH] Support adding widgets to widgets which not override Panel.add method like tables --- .../gwt/query/client/plugins/widgets/WidgetsUtils.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/WidgetsUtils.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/WidgetsUtils.java index 3c82a618..408d1336 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/WidgetsUtils.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/WidgetsUtils.java @@ -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); } -- 2.39.5