Tuesday, January 3, 2012

Re: Basic question on activity and places

If you have multiple display areas in your app you would have multiple ActivityMappers (one per display area, e.g. a master area and a detail area). Now if you go to a Place each ActivityMapper can return a different Activity based on the Place. So its more like one-to-<number of activity mappers>. A common example is that you have a ListEmailActivity that shows a list of emails and a EMailDetailsActivity that actually shows the selected email's content. Both can be started at the same time if the list of emails and the contents of the selected email are visible at the same time. If an ActivityMapper does not need to return an Activity for a place it can return null or return a default Activity that displays a message or something. You could use both methods, e.g. if you return null it means "hide the entire display area because I don't need it for that place" and if you want to show a message return a MessageActivity instead.

It can also happen that an ActivityMapper can start the same Activity for different places. For example you could have a single ListActivity that defines a general set of features for a list style view (for example searching the list, list ordering, etc.) but uses a ListAdapter to manage the displayed objects. If you now have EmailListPlace, PersonListPlace, etc. they all would start a ListActivity but for each Place the ListActivity would use a different ListAdapter, e.g. EmailAdapter, PersonAdapter, etc. 

-- J.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/ahsrTNbpg8gJ.
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