A rookie here.
I just started with Ray Ryan's Google IO talk and following some articles on Google Developers site. I have not used any of the GWT add-ons like GWTP or MVP4G or GIN or any other stuff. Just followed the contacts example on the GWT site and tried to model my case.
I have a DockLayout panel which has a header, a navigation tree on the left and a central main panel. All of this i have in a single DefaultView which implements DefaultPresenter .
Now i have a DialogBox which pops up when the user does something in the tree and this is modelled in DialogView and DialogPresenter respectively.
Now when i hide the DialogBox , i am ending up calling a new instance of DefaultPresenter from the AppController which by virtue creates a new DefaultView and all of my tree selections and other changes in the main central panel are gone.
- Is it possible to re use instances of presenters without creating a new one on history change ? (for eg, DefaultPresenter in my case)
- Is there a way in MVP pattern to pass controls between presenters with values persisting ?
- How to load a existing instance of a presenter inside app controller on an event fire ?
Or have i got the whole MVP architecture thing wrong ? I am now planning to have different presenters and views for each of my components say HeaderPresenter / HeaderView, TreePresenter / TreeView , MainContentPresenter/MainContentView ?So that i will only create new instances of presenters which i need (like MainContentPresenter ) and keep the existing ones as it is (like TreePresenter and HeaderPresenter) Does this solve my problem ? How would i stitch all of this different views in the browser window ? I am not using UiBInder , just sticking to basics .
Help me out all you experts, i am in a deadlock !