FileDownloader and Window to be closed

Hi guys,

I have an issue with the FileDownloader. I’m using Vaadin 7.1.15.

What I’m trying to accomplish:
Push a button in my app that opens a Window that asks the user for a filename.
The Window contains a download button that is extended by the FileDownloader.
The download button should close the Window (once the download is complete).

I tried to do the Window.close() in a ClickListener that I added to the download button => does not work reliably
I tried to do the Window.close in handleConnectorRequest of method in a SubClass of FileDownloader that I created => does not work reliably either

Does anybody have an idea, how to accomplish the desired behavior?

Thanks,
Markus