Wednesday, February 23, 2011

Re: GWT 2.1 MVP Multiple activities clarification help

Ernesto,

CachingHorizontalMasterActivityMapper is just a wrapper for
CachingActivityMapper and FilterActivityMapper.

The layout of our example requires that both master and detail display
regions are simultaneously visible.
This means that when a user navigate to a detail place, even the
master display region must be advised to ensure that what's displayed
on the master region is in sync with what's on the detail region.
This is the task of FilterActivityMapper, which is used to map detail
place activity to a corresponding master activity:

FilteredActivityMapper.Filter filter = new
FilteredActivityMapper.Filter() {
@Override
public Place filter(Place place) {
return place instanceof MailDetailPlace ? new MailListPlace() :
place;
}
};

CachingActivityMapper is useful when you don't want to instantiate a
new Activity every time a place change event occurs. Generally
speaking, Activity are meant to be light disposable object so
instantiating a new one on every place change event shouldn't be an
isssue. In our case, CachingActivityMapper is useful when a user
navigate from one detail to another and the master display region is
always the same and doesn't need to be reinstantiated.

--
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