Re: Document.get().getElementById(String) and $doc.getElementById(String) returning nulls

2010-07-02 Thread giacomo
Thank you for your reply. I did know that I had to add the element before calling those methods, but sure enough I had forgotten that the panel in line 4 hadn't been added yet, as it was part of a cascade of constructors. Your reply helped me point that one out. Thanks, G. On Jul 1, 10:55 am,

Document.get().getElementById(String) and $doc.getElementById(String) returning nulls

2010-07-01 Thread giacomo
Hi everyone! SUMMARY = I'm facing a problem with Document.get().getElementById(String) (in Java) and $doc.getElementById(String) (in JavaScript) returning nulls. My design goal is to define a div element in the Java code and add it to the document, so that I can then retrieve it in the

Re: Document.get().getElementById(String) and $doc.getElementById(String) returning nulls

2010-07-01 Thread Daniel Simons
i) The problem here is that you are trying to reference an element that has not yet been added to the dom. Check where you are adding the element...most likely a you have a call to RootPanel.get().add(elem). Be sure that this happens before calling getElementsById(). ii) I prefer to create my