you said (a Place is akin to a URL, it represents the "current state"
of your app.),
in my app this url (
http://demo4gwt.ecardbase.com/#exam:5--student:4--
menu:admin) represents 3 regions activity's lastPlaceName(with token),
current state is "exam:5",student:5 and menu:admin is other region's
last state, when user request a place it actually changes current
state's of url , other two tokenes shows us the other regions (which
not changed) last state,THE reason I changed URL is when user refresh
browser my app will load all regions places according to tokens in
url,
ExamActivity's start method is like this
public void start(AcceptsOneWidget panel, EventBus eventBus) {
panel.setWidget(display.asWidget());
String curr=History.getToken();
if(curr.startsWith(ExamPlace.TOKEN_NAME)&&curr.contains("--"))
{// if true ===refresh or forward the url.....
String[] places=curr.split("--");
for(int i=places.length-1;i>=0;i--){
History.newItem(places[i]);
}
}
}
------------------------------------------------------
I hava PlaceHistoryMapper and PlaceHistoryHandler ,it works well in
same Activity's different place(place name is different,try it on
http://demo4gwt.ecardbase.com/, load a place and click defferent page
NUM in the HTML tables page bar, then go back to previous page) ,but
it couldn't reconstruct the Activity (between different activity's
place) when I press go back . (click defferent menu item, then try to
go back to previous page). THAT is the problem.
I tried what you said (have 4 ActivityManagers, each one with its
ActivityMapper, each one controlling a "display region".)
in this case my app only displayed the requested place in correct
region,but other regions changed to blank, may be I didn't understand
exactly what you said , the code is :
NorthActivityMapper northActivityMapper =new NorthActivityMapper();
ActivityManager northActivityManager = new
ActivityManager(northActivityMapper,
eventBus);
northActivityManager.setDisplay(north);
CenterActivityMapper centerActivityMapper =new
CenterActivityMapper();
ActivityManager centerActivityManager = new
ActivityManager(centerActivityMapper,
eventBus);
centerActivityManager.setDisplay(center);
WestActivityMapper westActivityMapper =new
WestActivityMapper();
ActivityManager westActivityManager = new
ActivityManager(westActivityMapper,
eventBus);
westActivityManager.setDisplay(west);
----------------------------------------------------------------------
Other region dispaly blank is because of the code in XXXActivityMapper
is like this:
public Activity getActivity(Place place) {
if(place instanceof XXXPlace){
Activity activity=((XXXPlace) place).getActivity();
return activity;
}
return null;
}
if the code should not like this ,why should I have 4 ActivityMapper?
and please tell me what should I do to make my app to be able to load
differrent region's activity when user refresh the browser(http://
demo4gwt.ecardbase.com/#exam:5 it cant load all 3 region's last
state,but current state ),when user A forward the url to user B,user B
should see 3 regions display just like user A are looking right
now,not only one.
> For a more in-depth look, seehttp://
tbroyer.posterous.com, where I wrote a