469,929 Members | 1,597 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,929 developers. It's quick & easy.

adding elements created by DOM doesnot show up when added to Horizontal Panel

hi all,

I have created a DIV tag using DOM
.....
Element div = DOM.createDiv();

and appended Label inside it.
....
Element label = DOM.createLabel();
DOM.setAttribute(label, "value", "test");
DOM.appendChild(div, label);

now when I add this div to a horizontal Panel it does not shows up.
like
HorizontalPanel hp = new HorizontalPanel();
DOM.appendChild(hp.getElement(), div);

RootPanel.get("_slot1").add(hp);
though if I debug to c if the html string is getting appended ..it is !

when I paste that string in the html viewer it shows up the content....
But in case I c it in the GWT output it does not.

Summary:
The problem is why does horizontal panel (or any other Higher level
GWT panel) does not shows up the items added using DOM.createXXX()
methods??
I even tried it using.

DOM.appendChild(RootPanel.get("_slot1").getElement (),hp.getElement());

and through... setting the inner HTML as string
DOM.setInnerHTML(RootPanel.get("_slot1").getElemen t(),hp.getElement().toString);

pls help.
thanx in advance.
Dheeraj

Sep 19 '06 #1
4 1581


dh********@gmail.com wrote:

I have created a DIV tag using DOM
....
Element div = DOM.createDiv();
W3C DOM would be e.g.
Element div = domDocumentInstance.createElement("div");
or
Element div =
domDocumentInstance.createElementNS("http://www.w3.org/1999/xhtml", "div");

If you use something else then at least explain what kind of object DOM
is, what language you are using.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Sep 19 '06 #2
hi Martin,

Well, I am using Google Web Toolkit for Client side rendering (Java).
my objective is not in context to core javascript but about the GWT
class HorizontalPanel which the GWT compiler inturn converts to the
javascript language.

The problem statement i would again repeat is -
Why does HorizontalPanel (counterpart of Panel class in AWT (Java) )
which GWT provides does not shows up the items added using
DOM.createXXX()
methods??
like the example I stated in my previous post.

Pls tell if there is still any doubts about the description of the
problem.

Dheeraj

Sep 19 '06 #3
dh********@gmail.com wrote:
Why does HorizontalPanel (counterpart of Panel class in AWT (Java) )
which GWT provides does not shows up the items added
That sounds more like a Java problem (or a Google Toolkit problem) than
an XML or DOM problem. Did you remember to tell the HorizontalPanel to
refresh itself from the model?

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Sep 19 '06 #4


dh********@gmail.com wrote:

Well, I am using Google Web Toolkit for Client side rendering (Java).
my objective is not in context to core javascript but about the GWT
class HorizontalPanel which the GWT compiler inturn converts to the
javascript language.

The problem statement i would again repeat is -
Why does HorizontalPanel (counterpart of Panel class in AWT (Java) )
which GWT provides does not shows up the items added using
DOM.createXXX()
methods??
Does Google offer any support or at least any forums for that toolkit?
Then ask there, you are more likely to find expertise on specific
software in a dedicated forum than here in comp.text.xml, in particular
as the DOM you code is probably not even XML but HTML.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Sep 19 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

34 posts views Thread by Adam Hartshorne | last post: by
9 posts views Thread by Michelle | last post: by
2 posts views Thread by Richard Muller | last post: by
3 posts views Thread by Jim Heavey | last post: by
1 post views Thread by Carol | last post: by
3 posts views Thread by robert.oschler | last post: by
3 posts views Thread by Ben Dewey | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.