Stefan
Stefan

Reputation: 14863

A Element to RootPanel

how can I add a Element to the RootPanel? Is creating a HTML element from the Elements.toString() method really the only way?

Import names:

Regards, Stefan

Upvotes: 1

Views: 1132

Answers (2)

Thomas Broyer
Thomas Broyer

Reputation: 64541

Don't use widgets when what you want are elements.

Document.get().getBody().appendChild(element);

or

Document.get().getElementById("foo").appendChild(element);

Upvotes: 5

Ioan Agopian
Ioan Agopian

Reputation: 788

Try with:

RootPanel.get().getElement().appendChild(element);

Upvotes: 3

Related Questions