How to embedd a GWTP app into a web page?

Beperaige

New Member
I am using GWT-Platform and want to include my GWTP app as part of the hosted page. My host page contains the follwing element:\[code\]<div id="content"></div>\[/code\]My GWTP app should be attached to this div only. The GWTP documentation says you should write a RootPresenter Class as: \[code\]public class MyRootPresenter extends RootPresenter{ public static final class MyRootView extends RootView{ @Override public void setInSlot(Object slot,Widget widget){ RootPanel.get("mainContent").add(widget); } } @Inject public MyRootPresenter(EventBus eventBus,MyRootView myRootView ){ super( eventBus, myRootView ); }}\[/code\]In your gin module you should put:\[code\]bind(RootPresenter.class).to(MyRootPresenter.class).asEagerSingleton();\[/code\]instead of (bind(RootPresenter.class).asEagerSingleton();)But this will lead to an error which cannot be resolved.I tried:\[code\]bind(MyRootPresenter.class).asEagerSingleton();\[/code\]This is working, but not all the time. After restarting the GWTP app sometimes GWT does not seem to use it. The app is then attached to the main end of the host page.How can I get this working?
 
Back
Top