RootPanel.get(
"nameFieldContainer").add(nameField);RootPanel.get(
"passwordFieldContainer").add(passwordField);RootPanel.get(
"sendButtonContainer").add(sendButton);RootPanel.get(
"errorLabelContainer").add(errorLabel);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 <goca...@yahoo.com> 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);
On Feb 10, 8:49 am, go canal <goca...@yahoo.com> wrote:
> 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.
You should really use the clear() method of your different RootPanels,
or you'll leak memory (until the user leaves the page and/or closes
his browser window/tab).