首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >GWT DockLayoutPanel空白页

GWT DockLayoutPanel空白页
EN

Stack Overflow用户
提问于 2012-07-24 00:50:11
回答 1查看 366关注 0票数 0

我正在尝试在Jboss-errai应用程序中使用DockLayoutPanel。我的入口点类:

代码语言:javascript
复制
@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:

代码语言:javascript
复制
<!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中,它可以与任意一个文档类型一起使用

代码语言:javascript
复制
<!DOCTYPE HTML>

Mozilla Firefox 14中的空白页面,Chrome

代码语言:javascript
复制
<!DOCTYPE>

FF14中的空白页面,但它可以在Chrome中工作。

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

请指教我正确的解决方案!

EN

回答 1

Stack Overflow用户

发布于 2012-07-24 01:41:33

从文档中:

此小部件只能在标准模式下工作,标准模式要求在其中运行它的HTML页面具有显式声明。

所以这意味着:

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

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

代码语言:javascript
复制
<!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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11616902

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档