Problem in short: I have two modules inheriting a common module (without entrypoint) and one host page for each. Whichever it loads, it loads both at the same time on the page. I just want them to load and show themselves separately, not together in all pages..
When I start Login.html, it starts these both modules (they share the browser space vertically) and loads the correct entrypoint (Login extends Entrypoint) twice.
When I start Main.html, it starts these both modules each with the Main entrypoint...
I suspect to problem to be in the project structure, but we do not want to split one project/app into several projects just because of the modules.
Login:
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='Login'>
<inherits name='fqdn.Common' />
<stylesheet src='../Common.css' />
<!-- Specify the app entry point class. -->
<entry-point class='fqdn.Login' />
<module>
Main:
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='Main>
<inherits name='fqdn.Common' />
<stylesheet src='../Common.css' />
<!-- Specify the app entry point class. -->
<entry-point class='fqdn.Main' />
<module>
Login.html:
<html>
<head>
<link type="text/css" rel="stylesheet" href="css/Common.css">
<script type="text/javascript" language="javascript" src="Login/Login.nocache.js"></script>
</head>
<body>
...
</body>
</html>
Main.html:
<html>
<head>
<link type="text/css" rel="stylesheet" href="css/Common.css">
<script type="text/javascript" language="javascript" src="Main/Main.nocache.js"></script>
</head>
<body>
...
</body>
</html>
I have to admit, that both entrypoints share the same dir and lots of classes, but not the same Ginjector stuff. They are named myproject.client.Login and myproject.client.Main.
Is that a reason for GWT to fail? I would be happy to know a good fix or workaround for that situation :)
Update: added Main.java snippets
public class Main implements EntryPoint {
private Logger logger = Logger.getLogger(Main.class.getName());
private final GinMainInjector injector = GinMainInjector.INSTANCE;
private Place defaultPlace = GWT.create(TicketPlace.class);
private SimplePanel appWidget;
private EventBus eventBus;
public void onModuleLoad() {
logger.finest("Starting Main...");
eventBus = injector.getEventBus();
MainActivityMapper activityMapper = GWT.create(MainActivityMapper.class);
activityMapper.insertInjector(injector);
PlaceController placeController = injector.getPlaceController();
createAppWidgetPanel();
startActivityManager(activityMapper, eventBus);
startHistoryHandler(placeController, eventBus);
}
private void startActivityManager(ActivityMapper activityMapper, EventBus eventBus) {
ActivityManager activityManager = new ActivityManager(activityMapper, eventBus);
activityManager.setDisplay(appWidget);
RootLayoutPanel.get().clear();
RootLayoutPanel.get().add(appWidget);
}
}