Common Presenter for multiple views

38 views
Skip to first unread message

Charan

unread,
Mar 18, 2013, 10:24:09 AM3/18/13
to gwt-pl...@googlegroups.com
Hi,

I have a presenter which makes calls to Handler and get the data from server
same data is needed for another widget which is a miniature version of the existing view, but this will present all time in application.

Here what i have common is calls to handler, same handler and action objects.

What is the best way to design.

My possible solution :
1) Writing one Common class which has access to the dispatcher object (Inject through Ginjector), use the methods to get data.
But as per MVP architecture, dispatcher usage is restricted to presenter only, but this is non-presenter class.
2) Is there any otherway?

Rob Ferguson

unread,
Mar 18, 2013, 5:41:03 PM3/18/13
to gwt-pl...@googlegroups.com
Hi,

I assume that in your Presenter's onBind() you make a call to retrieve the required data.

And, that if the call is successful (onSuccess) you update the associated View (via a call to one or more methods declared in the Presenter's MyView interface e.g. setResultSet() or SetResult()).

Once you have the data you can use a custom event to notify the "other" view.

Cheers
Rob

Kiahu.com


--
You received this message because you are subscribed to the Google Groups "GWTP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gwt-platform...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Charan

unread,
Mar 19, 2013, 12:53:50 AM3/19/13
to gwt-pl...@googlegroups.com
One more issue,  miniature widget is required data all the time regardless of the actual view is been instantiated (Visited) or not.
Reply all
Reply to author
Forward
0 new messages