Hi,

You should not write the binary response in the Ajax response.
The ajax response should return a <redirect> that will point to a url where
the binary data will be written back.

Martin Grigorov
Wicket Training and Consulting


On Wed, Mar 26, 2014 at 4:25 PM, eaglei22 <jchojnack...@gmail.com> wrote:

> Thanks Martin,
>
> I guess what I am more curious in, is how come when I call the
> downloadLink.onClick(), or do:
>
>
>         public void onPostProcessTarget(AjaxRequestTarget target)
>         {
>            final File file = excelFile;
>            IResourceStream resourceStream = new FileResourceStream(
>                                                     new
> org.apache.wicket.util.file.File(file));
>
>            ResourceStreamRequestHandler handler = new
> ResourceStreamRequestHandler(resourceStream,  file.getName());
>            handler.setContentDisposition(ContentDisposition.ATTACHMENT);
>
> getPage().getRequestCycle().scheduleRequestHandlerAfterCurrent(handler);
>
>
> I get the ajax error as shown above thread. It's only on onClick() call, or
> when
> getPage().getRequestCycle().scheduleRequestHandlerAfterCurrent(handler);
> is called..
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/calling-downloadLink-onClick-directly-tp4665125p4665133.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to