This would be difficult to do due to how BrowserWindowOpener must work in order to play nicely with popup blockers. The click handler and window opening logic resides on the client side, so the server doesn’t get an opportunity to change anything between the click and the window opening. If there were a server roundtrip inbetween, many popup blockers would be triggered due to the popup not being a direct result of a user action.
A workaround might be to open a special UI that knows (eg. based on info in the session) where to redirect (eg. using Page.setLocation() or Navigator).
In Vaadin 7.1, one could probably use server push to keep BrowserWindowOpener’s clientside state up to date so that it always knows what page to open.
Ok, the method with the separate UI seems to work. Alas, init() is only called once (per session).
Which method is called every time, the tab with the UI is opened or the URL is changed?
I would like to reuse the window to display different content from different URLs.
Hmm, in that case you could probably use BrowserWindowOpener just once, to open a window with some known window name, and after that use a regular server-side click listener that calls Page.open() with the window name. I don’t think popup blockers interfere with changing the location of a window that’s already open, even if it’s done by the server.