I have a question related to the one that Michal Lichvar posted 2 years ago:
I want to provide a dynamic filename for the ResourceStream, i.e. the name of the resource being downloaded needs to depend on the name of a widget (in my case a tree-node) that was selected before the user clicks the Download button.
You suggestion back then was:
“…
Create a new StreamResource with the new name and use fileDownloadWrapper.setResource(streamResourceWithNewName);”
BUT: the code to create that new StreamSource and assign it would need to be executed after the user clicks the button. Otherwise I would need to create and assign such a StreamResource each and every time the user selected a widget just to be prepared for the (very rare) case that the user might click the download button after selecting that object.
One thus needs a piece of code that gets called and executed after the user clicked the button to create and assign the new StreamResource to the FileDownloadWrapper.
Is there any call-back that I could override? Or can I one add a click-listener to the button-wrapper? Or how can provide one provide a click-target dependent StreamResource to the FileDownloadWrapper?
Hope I could make myself clear…