开发者

GWT Replace div (not append!) with RootPanel

开发者 https://www.devze.com 2022-12-21 19:31 出处:网络
In GWT if I do RootPanel.get(\"s开发者_开发问答omeDiv\").add(myPanel); I invariably get: <div id=\"someDiv\"><div></div></div>

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

精彩评论

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

关注公众号