I’m trying to do page changes by opening new Windows, as suggested in
this article
. It seems to work pretty well when I use Buttons to initiate the change, but with LoginForm it just doesn’t.
Sample [code]
private void loginFormTest() {
LoginForm lf = new LoginForm();
lf.addListener(new LoginForm.LoginListener(){
@Override
public void onLogin(LoginEvent event) {
openAnotherWindowTest();
}
});
Button b = new Button(“Toolkit button”, new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
openAnotherWindowTest();
}
});
Window main = new Window(“Main window”);
main.addComponent(lf);
main.addComponent(b);
setMainWindow(main);
}
private void openAnotherWindowTest(){
Window newWindow = new Window(“Another window”);
newWindow.setName(“another”);
addWindow(newWindow);
getMainWindow().open(new ExternalResource(newWindow.getURL()));
setMainWindow(newWindow);
}
[/code]
With the regular Button the browser immediately changes url to “another/” and shows the new Window as intended.
With the LoginForm button the browser loads the new Window (the loading bar flashes to signal this). However the screen doesn’t change until I press F5 to refresh page, and the url still doesn’t change.
Is there a way to overcome my latest troubles?