On May 5, 2:25 pm, Ian Bambury <ianbamb...@gmail.com> wrote:
> Hi,
>
> In the docs for HTMLPanel getElementById() it says:
>
> "Finds an element within this panel by its id."
>
> whereas in practice, the following
>
>         HTMLPanel panel = new HTMLPanel("<div></div>");
>         Window.alert(panel.getElementById("id")==null ? "Not
> found":"Found");
>
> will alert 'Found' if there is an element with that ID somewhere else in the
> document. All getElementById() does is to temporarily attach the panel to
> the DOM (if it isn't already attached) and then do
>
> DOM.getElementById(id)
>
> Not what is says on the box.

Well, I'd say the doc could be clearer but it's not a bug per se.
You're supposed to know what you put into the HTMLPanel. If you're not
so sure, then it's up to you to check whether the returned element is
a child of the HTMLPanel
(panel.getElement().isOrHasChild(returnedElement))

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to