> RootPanel rp = RootPanel.get("bar");
> rp.getElement().setInnerHTML("");
> rp.add(someWidget);

Hellu, I finally upgraded to RC2 and did some testing concerning the
above.
I think we overlooked an important thing, something which was the
original problem:

I want to wrap a piece of existing html code and replace that with
some GWT created widgets/panels, but also be able to switch back to
the original html code that was wrapped.

This last remark is an important one, and isn't possible in the above
solution. That is the call setInnerHTML("") will remove the existing
html code, such that it can't be shown anymore when I want to switch
back to it.
Secondly, I get an attach exception (the one that is mentioned in the
first post). Why? I do something like this:

RootPanel parent = RootPanel.get("parent");
HTML child = HTML.wrap(Document.get().getElementById("child"));

<html>
...
<div id="parent">
 <div id="child">
   <p>some content</p>
     ....
 </div>
</div>
....
</html>

Then I want to set the child as as a child widget of the parent, such
that I call something like this:
parent.add(child), which generates an exception as the child is
already attached.
But due to erasing the inner content, it doesn't make sense anyway, as
the child doesn't contain any content anymore :(...
So bottom line: I can't do the HTML content switching with the current
GWT widgets as we thought we could.
Any idea's how I can still do this with the default GWT widgets ?

--
Ed

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to