Michael, check out the DownloadLink example here:
http://www.wicket-library.com/wicket-examples/linkomatic/home

Also check out the code for DownloadLink itself, and you'll see
1. Your IModel must return a File, but yours returns bytes.
2. The download is initiated in DownloadLink#onClick, which you have
blocked with your subclass.

Hope that helps,
Dan

On Sun, Oct 14, 2012 at 5:09 PM, Michael Jaruska
<michael.jaru...@gmail.com>wrote:

> Hi,
>
> what to add into onClick() in DownloadLink if I need return to client
> generated .pdf
> stream as a .pdf file?
>
> My code:
>
> IModel pdfStreamModel = new AbstractReadOnlyModel()
> {
>         public Object getObject()
>         {
>                 return getPdfStreamBytes();
>         }
> };
> DownloadLink downloadLink = new DownloadLink("downloadLink",
> pdfStreamModel, getPdfDocumentName())
> {
>         public void onClick()
>         {
>                 System.out.println("clicking works");
>         }
> };
>
> Model works, DownloadLink is added into my markup. But I can't find any
> example how to deal
> code into onClick() in DownloadLink in a way it will return my generated
> .pdf stream in model.
>
> Thank folks,
>
> MJ
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: 
> users-unsubscribe@wicket.**apache.org<users-unsubscr...@wicket.apache.org>
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to