On Feb 2, 6:00 pm, "Juan M.M.M." <[email protected]> wrote: > hi! > > I'm becoming exasperated because this class sometimes works fine and > sometimes it going crazy. Let's supose this HTML like mine > > ... > <body> > <div id="frame1"> > <div id="frame1.1"> > </div> > </div> > <div id="frame2"> > </div> > </body> > > In method OnModuleLoad() u can refeer with this sentence RootPanel.get > ("div_name") to the DIV layer without problems. Then if u do the same > but in another public method, for example u could be refeer to the > frame1 and frame2 layer BUT if u refeer to frame1.1, u will get this > error: > > 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.RootPanel.get(RootPanel.java:211) > at com.my.irn.client.IRn.DisplayResults(IRn.java:398) > at com.my.irn.client.IRn.Paginar(IRn.java:450) > > ... > > Why is hapenning with this class?
See: http://code.google.com/p/google-web-toolkit/issues/detail?id=3511 and linked issues. > Can I try another way to setWidgets, As suggested by rjrjr on the above-linked issue, you could use HTMLPanel: RootPanel frame1 = RootPanel.get("frame1"); HTMLPanel html = new HTMLPanel(frame1.getElement().getInnerHTML()); frame1.getElement().setInnerHTML(""); frame1.add(html); // then you can use html.addAndReplace("frame1.1", someOtherWidget) > setVisibility, etc to the DIVs layer. As I said on the above-linked issue, if all you want is setVisible, use Document.get().getElementById(...) instead of RootPanel.get(...) -- 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.
