Handling History items when using FilteredActivityMapper and CachingActivityMapper

126 views
Skip to first unread message

Shaun Tarves

unread,
Apr 3, 2012, 3:15:12 PM4/3/12
to google-we...@googlegroups.com
I am using a FilteredActivityMapper to redirect requests, in front of a CachingActivityMapper, but I'm getting strange behavior.

My filter has defined the following:

if (agreement not accepted): return Place B
if (not logged in): return Place C
return Place A

I initialize my browser history in the standard way, with a default place (say, Place A) to go to. Navigation to that place gets "interrupted" by the filter and returns a different place (Place B). Place B has a button to accept an agreement. On click, I call placeController.goTo(Place A). However, if the filter tries to redirect to Place C, I get stopped by the CachingActivityMapper saying that I'm attempting to return to the same (Place A) so nothing happens. It looks like the history isn't updated for the new place, only the original place.

I guess my general question is, do I need to manually add History items if a FilteredActivityMapper redirects to a new place? That is, should I be listening for PlaceChangeEvents somewhere. If so, where's the best place to do that?
Reply all
Reply to author
Forward
0 new messages