【发布时间】:2016-08-07 03:35:22
【问题描述】:
我真的很想在我的 GWT (2.8) 应用程序中使用 Errai UI(3.2.4)。我已经有了一个带有 EntryPoint 实现和 onModuleLoad 的设置。我有 restGWT 设置并与我的服务器(使用 Jersey)进行交互。
我找到的所有文档都假设您正在构建一个完整的 Errai 项目,从头开始使用 forge 插件。我不是。我只想使用模板和数据绑定。我正在使用准系统设置,我什至无法在我的应用中显示标签。
我有这个 GWT 入口点:
public class App implements EntryPoint
{
@Inject
private ApplicationContainer applicationContainer;
public void onModuleLoad()
{
RootPanel.get("root").add(applicationContainer);
}
}
还有ApplicationContainer:
@Templated
public class ApplicationContainer extends Composite
{
@DataField
private Element applicationContainer = DOM.createDiv();
@PostConstruct
public void init()
{
GWT.log("Initializing");
}
}
它是随附的模板:
<div id="applicationContainer" data-field="applicationContainer">
Application Container
</div>
我应该在浏览器中看到“应用程序容器”,但在浏览器控制台中出现此错误:
ComplexPanel.java:96 Uncaught TypeError: Cannot read property 'removeFromParent_0_g$' of undefined
小部件和模板名称相同,并且在同一个包中。我的小部件的创建就像文档显示的那样:http://erraiframework.org/getting-started/index.html#ErraiUIPage
有人能告诉我我在这里缺少什么吗?这方面的例子非常少,它们都假设一个完整的 Errai 项目。我还需要@EntryPoint 吗?我需要@PostConstruct 吗? Errai 甚至被设计成这样工作吗?
感谢您的帮助。
【问题讨论】:
-
你检查过我们的答案吗?