At 01:00 AM 10/9/2010, you wrote:
... I can't see why the exact piece of code you posted should fail. You've
got probably more going on.

ok.


You can avoid this problem if you programmatically construct the page.
Thus, the html should contain only a <div> with an ID, which you get
through RootPanel.get(id) and then you keep adding your widgets to
that.

ok. i can do that. but does it have to be a div? i want to arrange buttons and statuses in row?

the widgets that i attach will be just buttons and labels (i guess). my static html looks like:

    <div id="hookForCommand1"></div>
    <div id="hookForStatusForCommand1"></div>
    <div id="hookForCommand2"></div>
    <div id="hookForStatusForCommand2"></div>



If you prefer designing your page as static html and wrapping widgets
around them you need to understand how the widget hierarchy works. For
my taste, it's ill-documented but follows more or less this rule: if
widget A contains widget B, you need to attach first widget B and then
A.  ...

ok,. i think i can avoid those problems now.

thanks

On Oct 9, 4:15 am, Ray Tayek <[email protected]> wrote:
> hi, starting a project using eclipse galileo and a week old download
> of gwt eclipse plugin..
>
> i sometime get a: "A widget that has an existing parent widget may
> not be added to the detach list" error when doing the following type of thing:
>
> //<div id="bar">static bar</div>
> Label bar = new Label("bar label);
> bar.getElement().setId("barid");
> RootPanel.get("bar").add(bar);
> RootPanel rp = RootPanel.get("barid");
>
> this usually fails. doesn't seem to matter whether bar is a panel, an
> html, or a label (does seem to work with buttons though). seems like
> i am not using gwt properly and breaking some rule like:http://markmail.org/message/l3okzeqycanf5alg
>
> can someone point me to some doc on this?
>
> also, i am using gwt-logger. when this crashes, i get this big grey
> thing that says: "GWT Code Server Disconnected " which hides the log
> stiff and my html stuff. i have poor vision, is there some way to
> move the thing that has the "GWT Code Server Disconnected " so i can
> see what's underneath?
>
> what i am trying to do is to wire up a bunch of buttons (each of
> which makes an rpc call) with their corresponding status/result
> widgets. the staus/result can be just text for now (maybe some
> graphic that changes later).
>
> the button case fails if i try to do a RootPanel.get() immediately.
> if i do it in a click handler, it seems to work ok, so maybe it's a
> timing problem? ...

---
co-chair http://ocjug.org/

--
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.

Reply via email to