Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Programmatically open a new browser window
How to I programmatically open a new browser window (or tab)? In prevision versions, we have the following method in the Page
class:
page.open(url, "_blank", true);
and the handleRequest
(of the RequestHandler
) could handle it.
something like UI.getCurrent().getPage().executeJavaScript("window.open(xxxxxx,'_blank')");
should do the same, although you might want to go thumbs-up this ticket: https://github.com/vaadin/flow/issues/4869
Yes, I did thumps-up that ticket. However, the JavaScript workaround won't solve my problem because I wanted to generate some dynamic content in the handleRequest
method,
I'm not sure how that would be different with Page.open
? The request handler chain is processed in the same way regardless of the Framework version, if I understand correctly. You could pass some URL parameters there if you wanted some dynamic behavior.
Ok, the request handler chain is called and that solves my problem. Thank you.
For anyone looking at this thread, the framework now has UI.getCurrent().getPage().open(String url)
to open a new browser window programatically.