Actually, for my project I have two predefined HTML files (one for login and one for the application).
I have to use GWT and until now, the application(with its html file) and the login page are working well.
However I need to assemble the two modules, and I am wondering how can I make call from one html file to another with gwt? and should I define two different UIbinders, or I have to put everything in only one (if it is the last 开发者_如何转开发solution, how can I do it?)
Thanks.
If you need this all in one application, then you should have one html host page and two UiBinder files. One for main app page and one for login. You can programmatically show the login "page" when required.
You might want to read how to mage "pages" within GWT app: gwt multi-page application
Just create one html file and one module. In the html file, have two divs, such as:
<div id="login"/>
<div id="application"/>
In the module, import the Java classes that you had used for the application and the login screen. And then in your module's onModuleLoad() create the login and application panels, and add them like this:
RootPanel.get("login").add(loginPanel);
RootPanel.get("application").add(applicationPanel);
They should work just fine together. HTH.
精彩评论