Dan, thank you for links and points.

The true is that I have data in database so I would like streaming them. Is the 
right
way put them in temp file first and then send it into browser with DownloadLink?

After some googling I noticed that ResourceLink should be like DownloadLink but 
for me
better - it's for streamed data. But can't find any example for wicket 1.5 :-(

MJ


On 14.10.2012 21:00, Dan Retzlaff wrote:
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
<[email protected]>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<[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