On Dec 9, 7:58 am, jd <[email protected]> wrote: > Hi, > > I am using GQuery to return elements that I want to attach > ClickHandlers to like this: > > GQuery h2s = $("#header > h2 > a"); > Anchor lowestPriceAnchor = Anchor.wrap(h2s.get(0)); > > But I am getting an exception: > > java.lang.AssertionError: A widget that has an existing parent widget > may not be added to the detach list > at com.google.gwt.user.client.ui.RootPanel.detachOnWindowClose > (RootPanel.java:136) > at com.google.gwt.user.client.ui.Anchor.wrap(Anchor.java:59) > > Does anyone know what I am going wrong here?
The element you're trying to wrap is a child of an element that's the "root" element of a widget. A widget is supposed to control its subtree, so wrapping a widget's child element in another widget is prohibited, as the "parent" widget would be aware of it. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
