0
我想在Jboss errai应用程序中使用DockLayoutPanel。 我的入口点类:GWT DockLayoutPanel空白页
@EntryPoint
public class Application {
private Caller<UserService> userService;
private Label registerConfirmMessage;
@AfterInitialization
public void createUI() {
DockLayoutPanel p = new DockLayoutPanel(Unit.EM);
p.addNorth(new HTML("header"), 2);
p.addSouth(new HTML("footer"), 2);
p.addWest(new HTML("navigation"), 10);
p.add(new HTML("content"));
RootLayoutPanel.get().add(p);
}
我Application.gwt.xml:
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.4//EN"
"http://google-web-toolkit.googlecode.com/svn/releases/2.4/distro-source/core/src/gwt-module.dtd">
<!-- GWT module definition: the rename-to attribute is used to have a shorter
module name that doesn't reflect the actual package structure. -->
<module>
<inherits name="org.jboss.errai.common.ErraiCommon" />
<inherits name="org.jboss.errai.bus.ErraiBus" />
<inherits name="org.jboss.errai.ioc.Container" />
<inherits name="org.jboss.errai.enterprise.CDI" />
<inherits name="org.hibernate.validator.HibernateValidator" />
<source path="client" />
<source path="shared" />
</module>
我发现不同的结果,当我改变DOCTYPE。所以:
在IE6它要么DOCTYPE工作
<!DOCTYPE HTML>
空白页在Mozilla Firefox 14,Chrome的
<!DOCTYPE>
空白页的FF14,但它在Chrome工作。
所有其他文档类型导致空白页。
请指正我的问题,正确解决!
感谢。它部分帮助我。但现在我有另一个身高问题。我是否需要分配一些面板的高度(RootLayoutPanel,DocsLayoutPanel)?我希望我的DockLayoutPanel具有100%的屏幕高度。 – 2012-07-24 10:16:10
当你添加东,北,西和南时,你应该添加大小(北/南的高度和东/西的宽度),中心应该总是被添加到最后,它会占用所有剩余的空间。例如,如果你只是在中心添加一个按钮,那么它应该占用所有空间 – Spiff 2012-07-24 10:56:49
是的,我是按照你写的。我想我找到了解决方案与CSS:HTML,身体{高度:100%; } – 2012-07-24 11:03:51