Hi.
I thought I'd play with having multiple ActivityMappers. Here's what I've
got so far:
@Override
public void onModuleLoad() {
DockLayoutPanel containerWidget = new DockLayoutPanel(Unit.PX);
SimplePanel headerWidget = new SimplePanel();
SimplePanel mainWidget = new SimplePanel();
ClientFactory clientFactory = GWT.create(ClientFactory.class);
EventBus eventBus = clientFactory.getEventBus();
PlaceController placeController = clientFactory.getPlaceController();
HeaderActivityMapper headerActivityMapper =
newHeaderActivityMapper(clientFactory);
ActivityManager headerActivityManager =
newActivityManager(headerActivityMapper, eventBus);
headerActivityManager.setDisplay(headerWidget);
MainActivityMapper mainActivityMapper = newMainActivityMapper(clientFactory);
ActivityManager mainActivityManager = newActivityManager(mainActivityMapper,
eventBus);
mainActivityManager.setDisplay(mainWidget);
containerWidget.addNorth(headerWidget, 200);
containerWidget.addEast(mainWidget, 500);
RootPanel.get().add(containerWidget);
AppPlaceHistoryMapper historyMapper = GWT.create(AppPlaceHistoryMapper.
class);
PlaceHistoryHandler historyHandler = newPlaceHistoryHandler(historyMapper);
historyHandler.register(placeController, eventBus, defaultPlace);
historyHandler.handleCurrentHistory();
// where should I put this?
clientFactory.getPlaceController().goTo(new HeaderPlace());
}
There is a problem though. *clientFactory.getPlaceController().goTo(new
HeaderPlace());* correctly sets the header, but in the process it it clears
out the other activity. If I comment out that line, the other activity
correctly displays *defaultPlace*. HeaderPlace is only checked for in
*HeaderActivityMapper,
*the the place for *defaultPlace *is only checked for in *MainActivityMapper
*.
Any idea what's wrong?
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.