Hi,
I need to show my GWT application inside a div, so I wrote a custom RootPresenter as described in the documentation:
http://code.google.com/p/gwt-platform/wiki/GettingStarted?tm=6#Embedding_a_GWTP_app_in_a_webpageThe problem I am having now is that none of the PresenterWidgets are loaded. However, if I run the page using the default GWTP's RootPresenter everything is shown fine.
I placed a div with id "myContainer" in my welcome page and my RootPresenter presenter looks like this:
public class MyRootPresenter extends RootPresenter {
@Inject
public MyRootPresenter(EventBus eventBus, RootView view) {
super(eventBus, view);
}
@Override
public void setInSlot(Object slot, PresenterWidget<?> content) {
RootPanel.get("myContainer").add(content);
}
}
The binding in the Gin module is done this way:
bind(RootPresenter.class).to(MyRootPresenter.class).asEagerSingleton();
The PresenterWidgets are added in the onReveal method of the presenter that is revealed as root content:
@Override
protected void onReveal() {
super.onReveal();
setInSlot(TYPE_SetRegisterContent, registerPresenter);
setInSlot(TYPE_SetLoginContent, loginPresenter);
}
registerPresenter and loginPresenter are PresenterWidget type variables which are injected using Gin:
bindSingletonPresenterWidget(LoginPresenter.class, LoginPresenter.MyView.class, LoginView.class);
As I said, all the presenters are shown if I use the default RootPresenter, but none of them if I use a custom RootPresenter.
Can anyone help me solving this problem? I really need to show the application into a div.
Thank you.