Hi!
--
You received this message because you are subscribed to the Google Groups "Mvp4g" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mvp4g+un...@googlegroups.com.
To post to this group, send email to mv...@googlegroups.com.
Visit this group at http://groups.google.com/group/mvp4g.
For more options, visit https://groups.google.com/d/optout.
I already understood the issue. So that since I have multi level of RootView and RootPresenter, I mean the one of the top level that have to behave as a dispatcher and the two others of the sub level and each one of them have to use the changeRootBody() method in order to put different views inside.
In other words, if we consider our top RootView is an empty view in which we'll display one of the double SubRootView, so in this case we'll use the changeRootBody() method of the RootPresenter. on the other side, SubRootPresenter1 and SubRootPresenter2 have also this method in order to fill their SubRootView with different project views, so in this case we'll have a conflict even when I subscribe these method with different name in the MainEventBus, it doesn't work.
To be more clear, in my LoginPresenter, I use an UiHandler on the LoginButton which will direct me to one of the 2 project using the radionButton. If we suppose we chose project 1, ther is the code:
LoginView:
if(radioProj1.getValue())
presenter.onBottonProj1Click();
LoginPresenter:
public void onBottonProj1Click(){
eventBus.goToSubRoot1();
eventBus.goToHome1();
}
SubRootPresenter1
public void onGoToSubRoot1() {
eventBus.changeRootBody(view.getViewWidget());
}
HomePresenter1
public void onGoToHome1()
{
eventBus.changeBody(view.getViewWidget());
}
MainEventBus
@Events(startPresenter=RootPresenter.class)
public interface AppEventBus extends EventBus{
@Start
@Event(handlers = {LoginPresenter.class, RootPresenter.class })
public void start();
@Event(handlers = {RootPresenter.class})
public void changeRootBody(Widget widget);
@Event(handlers = {HomePresenter.class, SubRootPresenter1.class, RootPresenter.class})
public void goToHome1();
@Event(handlers = {SubRootPresenter1.class})
public void changeBody(Widget w);
@Event(handlers={SubRootPresenter1.class})
public void goToSubRoot1();
@Event (handlers = {LoginPresenter.class})
public void goToLogin();
}
So here is the whole of my main pages code, so if someone could read carefully the code and try to detect what's wrong with this code and how could I resolve the changeBody() method problematic , I'd be very grateful.