That's not the preferred way of working though. If you want to play
nice with the framework, you should either make it a resource - imo
the most elegant solution, and again, look at
wicket-contrib-jasperreports - or a custom request target. By using
WebResponse directly like that, you are circumventing the RequestCycle
processing and it thus can be considered being a hack.

Eelco

On 3/21/06, Timo Stamm <[EMAIL PROTECTED]> wrote:
> Mats Norén schrieb:
> > I'm trying to export a POI worksheet as a download link in my wicket page.
> > The link sets the responsepage to a download page in which
> > trying to get the outputbuffer to write to.
>
>
> You can do that directly from your link, without an intermediate page.
> At least it works with buttons with a form, but I don't think a link
> makes any difference:
>
>
> protected void onSubmit() {
>     WebResponse r = (WebResponse)getRequestCycle().getResponse();
>     r.setContentType("application/octet-stream");
>     r.setHeader("Content-Disposition",
>                    "attachment; filename=\"data.abc\"");
>     r.write("data");
>     getRequestCycle().setResponsePage((WebPage)null);
> }
>
> See wicket.examples.displaytag.export.Export for a more complete example.
>
> This is what I am using with wicket 1.1.1.
>
>
> Timo
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live webcast
> and join the prime developer group breaking into this new coding territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to