Saturday, December 3, 2011

GWT MVP & Multiple Areas Doubt

In my app I have layout like gmail. A header, a left panel (with a
menu), a main content area (with a header and a content area).

Example:

---------------------------------------------------------------
| username logout|
------------------------------------------------------------------
| aside | add, delete, other action |
| menu | ----------------------------------------------------|
| | filter by a, b, c |
| | ----------------------------------------------------|
| | maincontent (ie: celltable) |
| | |
| | |
| | |
| | |
| | |
-------------------------------------------------------------------

Aside Menu will be created after the user logins and remains during
the entire session.

The same for the header.

Now, my doubt is about the main content area (actions panel, filters
panel and main content panel).

What I did to get this layout working is:

1. I created two widgets, MainDisplayFilters and MainDisplayActions.
2. I created an AppLayout and injected those widgets.
3. In every one of my views, for example UsersListView, I inject
MainDisplayFilters and MainDisplayActions, clear the widgets, and add
to the widgets the buttons for the actions and the filters that I need
in the current activity.

I really DONT like this approach :) but I can't figure how can I do it
in a better way. Should I create an ActionsActivityMapper and a
FiltersActivityMapper, and diferent activities / views for this panels
for every place that the user goes? For example, if the user goes to
UserListPlace, load the UserListActionsActvity (with it owns view) and
the UserListFiltersActivity? It doesn't make many sense, I think.

I was reading about Thomas Broyer post http://tbroyer.posterous.com/gwt-21-activities-nesting-yagni
but actions panels and filters panels are in someway connected to the
maincontent activity, that's why I believe that I don't need more than
one ActivityMapper.

I neither don't like the idea to have the actions panel + the filters
panel + content panel all in one view, beacause if in the future I
want to change something in the layout (for example add a pagination
control on the right of my actions panel), I would have to do it in
every view.

Wich one would be the best way to handle a layout like this?

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment