setlogouturl problem

Hi,
I am calling a vaadin application (fileupload) from my web app on the button click with a new pop up window.
Now, I close the window, the window close event is prefetly fired, and I wrote setlogoutURL just before I close the app.
All, I want the parent window to redirect to my home page…But, somehow it is not happening.

	mainWindow.getApplication().setLogoutURL("/home.do");
	mainWindow.getApplication().close();

Hi,

Did I understand this correctly: your homepage, in browser window A, is not made with Vaadin, but it opens another browser window B with a Vaadin application?

You see, if this is the case, the Vaadin application in B does not know about A, and can not refresh it - instead it will try to redirect B to your homepage, but since it’s B that you’re closing you’ll never see that.

Now, if you open the Vaadin app / window within browser window A, then that’s a different story - that should work perfectly, sort of like this:

public class AtestApplication extends Application {
    @Override
    public void init() {
        final Window mainWindow = new Window("Atest Application");
        Label label = new Label("Hello Vaadin user");
        mainWindow.addComponent(label);
        setMainWindow(mainWindow);

        Window w = new Window();
        w.addListener(new Window.CloseListener() {
            @Override
            public void windowClose(CloseEvent e) {
                mainWindow.getApplication().setLogoutURL("/home.do");
                mainWindow.getApplication().close();
            }
        });

        mainWindow.addWindow(w);
    }

}

Best Regards,
Marc

P.S in the first case, you could try window.open with the name of window A, but 1) that assumes window A has a name and 2) I’m not sure the client will try to open the window and even if it does 3) the browser might not allow the closing window to do that