开发者

GWT Replace div (not append!) with RootPanel

In GWT if I do RootPanel.get("s开发者_开发问答omeDiv").add(myPanel); I invariably get: <div id="someDiv"><div></div></div>

But, I just want 1 level of hierarchy, i.e., <div id="someDiv"><div> where the someDiv contains myPanel.

Any ideas? Thanks!


A Panel has to be a div (or table or span). Your RootPanel is a div, and the Panel you add to it is a div.

If you're writing a full-page app, RootPanel.get() returns the element, so adding a div to that will only result in one div inside the

But honestly, trying to get rid of one nesting of divs in your application is not going to save you any noticeable amount of time.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜