How to deal with embedded views?

1 view
Skip to first unread message

Shelley

unread,
Jul 22, 2010, 1:15:09 AM7/22/10
to gwt-mvc
hi all:
seems Gwt-MVC deal with this situation best: one controller->one or
more view, and these view does not coupling together. then the
relationships between controller and views is straightforward.
but how to deal with several views which coupling together?

i was doing a project, the app's main view is a dockpanel, which has
north, east, west and south areas each containing a widget, i consider
each area should has a controller and a view, the view will be
initialized in the controller's init() methods. then it will be
straightforward that the control will handle the event issued by the
view. but how to integrate the views together? where to integrate?
if in the root control, in the init() method you first create a
dockpanel, then you have to create several views and put it into the
dockpanel, but the "several views" should be create by their own
controller, not the root control.

anyone has suggestions for this? thanks in advance.

-Shelley

Francois Wauquier

unread,
Jul 24, 2010, 2:53:19 AM7/24/10
to gwt-mvc
Hi

Look at the the SHOW_COMPLEX exemple in the demo.
When you have something wich is not a view but more a layout or a way
to place or aggregate views, gwt-mvc introduce the DomPlacer concept.
You can write your own DomPlacer based on DockPanel.
You would have to find a way to share it through your different
controllers.
http://gwt-mvc.googlecode.com/svn/trunk/gwt-mvc-poc/demo/0.4/com.googlecode.gwtmvc.poc.GwtMvcPoc/GwtMvcPoc.html#SHOW_COMPLEX
http://code.google.com/p/gwt-mvc/source/browse/trunk/gwt-mvc-poc/src/main/java/com/googlecode/gwtmvc/poc/client/controller/PocController.java

You'll find my shared reflexions about that here :
http://groups.google.com/group/gwt-mvc/browse_thread/thread/bba0671fb490bdb7

François Wauquier
Reply all
Reply to author
Forward
0 new messages