From 59e9e9b347b37d8fff719b101c58edca51ad2a4d Mon Sep 17 00:00:00 2001 From: Julien Dramaix Date: Sat, 5 Mar 2011 19:51:13 +0000 Subject: [PATCH] check if a widget is not yet attached to the element before to create a new one --- .../java/com/google/gwt/query/client/plugins/Widgets.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Widgets.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Widgets.java index d5a08fb9..a4fcceee 100755 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Widgets.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Widgets.java @@ -157,7 +157,12 @@ public class Widgets extends QueuePlugin { */ protected W widget(Element e, WidgetFactory factory, Function... initFunctions) { - + + if ($(e).widget() != null){ + //a widget is already attached on this element !! + return null; + } + W widget = factory.create(e); if (initFunctions != null) { -- 2.39.5