GWT DockLayoutPanel空白页

问题描述 投票:0回答:1

我正在尝试在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);
}

我的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中使用。

所有其他文档类型导致空白页。

劝我请正确的解决方案!

gwt errai
1个回答
1
投票

从文档中:

该窗口小部件仅在标准模式下工作,这要求运行该窗口小部件的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项目的组织方式:

https://developers.google.com/web-toolkit/doc/latest/DevGuideOrganizingProjects

© www.soinside.com 2019 - 2024. All rights reserved.