GWT Replace div (not append!) with RootPanel

青春壹個敷衍的年華 提交于 2019-12-25 06:29:12

问题


In GWT if I do RootPanel.get("someDiv").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!


回答1:


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.



来源:https://stackoverflow.com/questions/2338303/gwt-replace-div-not-append-with-rootpanel

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!