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

D

dheerajsah

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").getElement(),hp.getElement().toString);

pls help.
thanx in advance.
Dheeraj
 
M

Martin Honnen

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.
 
D

dheerajsah

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
 
J

Joseph Kesselman

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?
 
M

Martin Honnen

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,781
Messages
2,569,619
Members
45,316
Latest member
naturesElixirCBDGummies

Latest Threads

Top