Hi,

override IRequestListener#rendersPage() to return false, to prevent an RenderPageRequestHandler from being scheduled.

Take a look at the new AjaxDownloadBehavior as an alternative - it should make the whole process easier.

Have fun
Sven


Am 02.01.2018 um 12:08 schrieb Ravi:
Hi all,

I'm currently migrating our project to wicket 8. The migration guide was a
big help, thank you for that :)

I could solve all but one problem regarding an internal file download.
We have an ajax-button that returns a
"/window.location.href='dynamic-url/'".
Somehow I'm always getting the page source as a response, instead of the
actual file.

Technically I have a page implementing the /IRequestListener/ interface for
the /onRequest()/-method.
That page holds an ajaxlink that returns the above mentioned js-snippet with
the url generated by "/urlForListener(new PageParameters())/" method on the
page.
In /onRequest()/ we create a /ResourceStreamRecource /that should be
delivered to the user.
Something like this:            
                /final Attributes a = new Attributes(cycle.getRequest(),
cycle.getResponse(), null);
                resource.setFileName(new Date().getTime() +".txt");
                resource.respond(a);
/
I can see that /onRequest /gets called, but what's delivered in the frontend
is always the page markup.
Also if I click the link again I'm getting a /StalePageException/.

Any idea what might cause this behavior?

I also upload a quickstart that shows the problem.
myproject.7z
<http://apache-wicket.1842946.n4.nabble.com/file/t375522/myproject.7z>

Thanks for your help,

Ravi

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to