I have to create multi-level views for eg. TopLevelView contains a series of button horizontally place (works as menu).On clicking on buttonX-TopLevelView,It creates anotherView call MiddleView that gets appended in the container of TopView. Similary MiddleView has same structure as TopView. When we click on a buttonY-MiddleView which opens InnerLevel-View.
Now suppose we call URL : 127.0.0.1:7777/demoapp#innerLevel
I thought the flow as following
Pseudo Code :
First check for string innerLevel in appController history Tokenizer.
if ( token.equals("innerLevel"){
presenter = new TopLevelPresenter(eventBus,rpcService,new TopLevelView(),token);
presenter.go();
}
Now contructor of TopLevelPresenter will through event for creation of MiddleLevel if token.equals("innerLevel")
eventBus.fireEvent(MiddleLevelEvent);
MiddleLevelEvent should contains name of lower level.
again in app controller I will check for history Tokenizer.
if ( token.equals("middleLevel"){
presenter = new MiddleLevelPresenter(eventBus,rpcService,new MiddleLevelView(),**what to pass here**);
presenter.go();
}
But I am feeling method I have thought is not good.Can anyone help me to tell what is standard way of using multi level view in GWT application using MVP.