GWT DockLayoutPanel空白页

GWT DockLayoutPanel空白页,gwt,errai,Gwt,Errai,我试图在Jboss errai应用程序中使用DockLayoutPanel。 我的入门课程: @EntryPoint public class Application { private Caller<UserService> userService; private Label registerConfirmMessage; @AfterInitialization public void createUI() { DockLayoutPanel p = new D

我试图在Jboss errai应用程序中使用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);
}
@EntryPoint
公共类应用程序{
专用呼叫用户服务;
专用标签注册器确认消息;
@后初始化
public void createUI(){
DockLayoutPanel p=新DockLayoutPanel(单位:EM);
p、 addNorth(新HTML(“标题”),2);
p、 addSouth(新HTML(“页脚”),2;
p、 addWest(新HTML(“导航”),10);
p、 添加(新的HTML(“内容”);
RootLayoutPanel.get().add(p);
}
My 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中工作

所有其他doctype导致空白页


请告知我正确的解决方案!

来自文档:

此小部件将仅在标准模式下工作,这要求 运行它的HTML页面具有显式声明

这意味着:

1.浏览器需要在标准模式下运行,而不是在怪癖模式下运行

2.在HTML文件的开头,您应该有以下内容:

<!doctype html>
<!-- The DOCTYPE declaration above will set the     -->
<!-- browser's rendering engine into                -->
<!-- "Standards Mode". Replacing this declaration   -->
<!-- with a "Quirks Mode" doctype is not supported. -->

doctype在应用程序启动的HTML页面中定义

而不是gwt.xml

另请查看下面的链接,它描述了gwt项目的组织方式:


谢谢。这对我有一定帮助。但现在我在高度方面遇到了另一个问题。我是否需要指定某些面板(RootLayoutPanel、DocsLayoutPanel)的高度?我希望DockLayoutPanel的屏幕高度为100%。当您添加东、北、西和南时,您应该添加大小(北/南的高度和东/西的宽度),应该始终在最后添加中心,它会占用所有剩余空间。例如,如果您只在中心添加一个按钮,那么它会占用所有空间。是的,我按照您所写的那样做。我想我找到了css:html的解决方案,body{height:100%;}