Allow a user to download a file in Vaadin 13

Hi, does anyone know what happened with the FileDownloader?
How can I allow the user to download a file I generate on the server using Vaadin 13?

This is quite frequently asked question. Here is one discussion thread about the topic with solution examples:

https://vaadin.com/forum/thread/17434646/vaadin-10-let-user-download-a-file-with-dynamically-defined-filename

Thank you very much! This worked.

It seems that the latest Vaadin 14 (14.4.2 for me) broke something. After the download with the solutions above the client-side UI is unresponsive and requires a page refresh to come back (F5 on the browser).

The solution I have that worked was to open the download URI as a new window with:

UI.getCurrent().getPage().executeJs("window.open('"+registration.getResourceUri()+"', \"_blank\", \"\");");

The drawback of this is that the browser might complain about the page opening a link and block it but users should be used to this behaviour.