我正在尝试在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 HTML>Mozilla Firefox 14中的空白页面,Chrome
<!DOCTYPE>FF14中的空白页面,但它可以在Chrome中工作。
所有其他文档类型都会导致空白页面。
请指教我正确的解决方案!
发布于 2012-07-24 01:41:33
从文档中:
此小部件只能在标准模式下工作,标准模式要求在其中运行它的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
https://stackoverflow.com/questions/11616902
复制相似问题