Wednesday, August 31, 2011

Re: RootPanel Widget - Attach, detach, attach again


Sorry. Nobody has time to go through code. I understand that.

Let me try to explain it in another way:

RootPanel rp = RootPanel.get( "DIV_ID" );
rp.add( widget1 );
rp.add( widgetN );
RootPanel.detachOnWindowClose( rp );

At this point in time the event handlers of widget1 through widgetN works allright.

Later on I need to get rid of this set of widgets and replace then with another one, so I tried the following:

rp.clear(); // To remove widget1 through widgetN
rp.removeFromParent(); // To "unbind" from "DIV_ID"

Then I start again (in another part of the code) with a new set of widgets, but using the same "DIV_ID" of the host Html page, but the event handlers of this new set of widgets does not work. If I use another element id of the same host page, say "DIV_ID_2", it works.

There is something completely wrong in my undestanding of the GWT about this point?



You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment