Hi,
Thanks for your reply.
I have not tested but I think getElement().setInnerHTML will work.
First, I thought that I can juse use RootPanel.get().clear() to remove
everything on the current page; then I hope I can use something like
RootPanel.get("id").clear() if I have sometign like this in my html file:
<div id="id"></div>
But it does not work..
So looks like I need to use setInnerHTML.
rgds,
canal
________________________________
From: Ashar Lohmar <[email protected]>
To: Google Web Toolkit <[email protected]>
Sent: Tue, February 9, 2010 10:35:06 PM
Subject: Re: RootPanel.get()..clear() does not clear the page
Hi
the clear() method on the HasWidgets objects only removes the child
widgets that had been added to it by using the add method
in you case the logic is kind of ok, the
RootPanel..get("nameofcontainer") is a child of RootPanel.get() in the
DOM point of view, but
but not for the HasWidgets object represented by the RootPanel..get()
an work around would be to do something like
RootPanel.get().getElement().setInnerHTML(""); but the when you'll try
an RootPanel.get("nameofcontainer") you'll get nothing because there
will no more be an object with the id=nameofcontainer
also it's possible to end up with "artifacts" object that you may have
in memory but don't exist in the page/document (i don't know if this
is true for sure).
hope I managed to explain it so that you could understand my point
good luck in finding a solution, or if you'll come back with more
details of what you want to achieve maybe I/we would be able to help
more.
On Feb 8, 4:46 am, go canal <[email protected]> wrote:
> Hi,
> I try to add RootPanel.get().clear() in the callback but it does not clear
> anything. If I use RootPanel.get("nameofcontainer").clear(), then it works -
> that widget is removed.
>
> I am using the default greet example. GWT 2.0.1, Chrome browser. This is how
> I create the widgets:
> RootPanel.get(
> RootPanel.get(
> RootPanel.get(
> RootPanel.get("nameFieldContainer").add(nameField);"passwordFieldContainer").add(passwordField);"sendButtonContainer").add(sendButton);"errorLabelContainer").add(errorLabel);
>
> Did I understand RootPanel.get().clear() correctly - I thought it will
> clear everything on the page
> rgds,
> canal
--
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.
--
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.