Actually I have 2 example use cases:

1) user selects files on file tree
2) as soon as file is selected and download is enabled for it, used can
press ajax download button and get the file

Another case:
User requests system backup
As soon as backup is created (Progress complete)
Download of newly created file should be initiated

I can't create ResourceReference and override getResourceStream of it since
I only have resource just before download

On Wed, Mar 22, 2017 at 6:53 PM, Martin Grigorov <[email protected]>
wrote:

> Hi Maxim,
>
> I use the new AjaxDownload with a ResourceReference, i.e.
> AjaxDownload#AjaxDownload(org.apache.wicket.request.
> resource.ResourceReference,
> org.apache.wicket.request.mapper.parameter.PageParameters)
> The ResourceReference has
>
> public IResource getResource() {
>     return new StatementDownloadResource();
> }
>
> StatementDownloadResource extends ResourceStreamResource and provides
> implementation of #getResourceStream(). There I have a logic that returns
> either FileResourceStream or ZipResourceStream.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Wed, Mar 22, 2017 at 12:30 PM, Maxim Solodovnik <[email protected]>
> wrote:
>
> > Just have tried to switch to this AjaxDownload component
> > And it seems I cannot find proper way to use it with dynamic file, i.e.
> >
> > previously
> > I created AjaxDownload,
> > added it to the page
> > then at the moment I know what file should be served, I set the stream
> and
> > initiate the download
> > (for example one of use cases: I need to create zip file
> >
> > right now this seems to be impossible :(
> > Can you give me a hint how this dynamic nature can be implemented?
> >
> >
> > --
> > WBR
> > Maxim aka solomax
> >
>



-- 
WBR
Maxim aka solomax

Reply via email to