Hi,

1) often the resource stream holds some big data (e.g. byte array) and this should definitely not be held in the component tree.

2) please take a look at AjaxDownloadPage in wicket-examples, setting the file name works fine there (just tested).

Have fun
Sven


On 07.04.2017 21:07, Sebastien wrote:
You made my day, Sven! I tested it and it works! :)

I have 2 comments:

1/
With this lazy creation of the stream, it is not necessary to hold it in
the component tree.
Not sure I understood what you meant but the ajax download still need to be
hold in the component tree right? As it is an AjaxBehavior, I do not figure
out how it can work otherwise..

2/
The content-type is supplied to the (Abstract)ResourceStreamWriter as
text/csv. It works too - I can download it - but whatever the filename I
provide to the ResourceStreamResource, the download dialog always suggest
".csv" (no filename, only the extension). Weird, I have to dig into this...

Thanks again & best regards,
Sebastien.


Reply via email to