Details
-
Type:
Improvement
-
Status: Closed
-
Priority:
Minor
-
Resolution: Invalid
-
Affects Version/s: 1.1.0.M3
-
Fix Version/s: None
-
Component/s: GWT
-
Labels:None
Description
In complex applications, you'll quite often (I guess) have a need for nested ActivityManagers: an Activity starts an ActivityManager to handle child activities in nested "display" regions.
While it's easy to create an ActivityManager and have it react to later place change/change-request events, it's impractical to initialize it with the child-activity corresponding to the current place: because the ActivityManager is created in response to a PlaceChangeEvent, it won't receive the event itself. The only solution seems to be to fake a PlaceChangeEvent, taking advantage of ActivityManager directly implementing PlaceChangeEvent.Handler and directly calling its onPlaceChange method:
ActivityManager subActivities = new ActivityManager(mapper, eventBus);
subActivities.setDisplay(subactivitiesDisplay);
subActivities.onPlaceChange(new PlaceChangeEvent(placeController.getWhere());