You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by okrohne <ok...@yahoo.de> on 2010/11/13 19:02:26 UTC

Redirect after download a pdf

Hi,

after a form submit I create a PDF which I send to the user with a
ResourceStreamRequestTarget ,
now after the user has downloaded the pdf I want  to redirect the user to a
"completion page",
how can I achieve that?

Thanks,
Oliver
-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Redirect-after-download-a-pdf-tp3041112p3041112.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Redirect after download a pdf

Posted by okrohne <ok...@yahoo.de>.
Ernesto,

thank your for the hints, instead of ajax I will modify a normal Link which
URL gets called
on page load via jquery. 

Regards,
Oliver

-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Redirect-after-download-a-pdf-tp3041112p3041599.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Redirect after download a pdf

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
or in place of a timer an AJAX lazy loading panel.

Ernesto

On Sun, Nov 14, 2010 at 10:07 AM, Ernesto Reinaldo Barreiro
<re...@gmail.com> wrote:
> Oliver,
>
> Just one idea:
>
> -Put an AJAX timer (of one second?) on your page
> -Use approach on [1] to trigger download
>
> Regards,
>
> Ernesto
>
> 1-https://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html
>
> On Sun, Nov 14, 2010 at 8:46 AM, okrohne <ok...@yahoo.de> wrote:
>>
>> I thought that too, my first attempt was like that, in the constructor of the
>> completion page:
>>
>> ResourceStreamRequestTarget target = new ResourceStreamRequestTarget(
>>                    new PDFResourceStream(new ByteArrayInputStream(pdf),
>> pdf.length));
>>               target.setFileName("report.pdf");
>>
>>             getRequestCycle().setRequestTarget(target);
>>
>> Then no download started, if I call this code in the "on submit" of the
>> previous page it does works.
>>
>> Any hint what is wrong with my code above?
>>
>> Thanks,
>> Oliver
>> --
>> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Redirect-after-download-a-pdf-tp3041112p3041534.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Redirect after download a pdf

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Oliver,

Just one idea:

-Put an AJAX timer (of one second?) on your page
-Use approach on [1] to trigger download

Regards,

Ernesto

1-https://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html

On Sun, Nov 14, 2010 at 8:46 AM, okrohne <ok...@yahoo.de> wrote:
>
> I thought that too, my first attempt was like that, in the constructor of the
> completion page:
>
> ResourceStreamRequestTarget target = new ResourceStreamRequestTarget(
>                    new PDFResourceStream(new ByteArrayInputStream(pdf),
> pdf.length));
>               target.setFileName("report.pdf");
>
>             getRequestCycle().setRequestTarget(target);
>
> Then no download started, if I call this code in the "on submit" of the
> previous page it does works.
>
> Any hint what is wrong with my code above?
>
> Thanks,
> Oliver
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Redirect-after-download-a-pdf-tp3041112p3041534.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Redirect after download a pdf

Posted by okrohne <ok...@yahoo.de>.
I thought that too, my first attempt was like that, in the constructor of the
completion page:

ResourceStreamRequestTarget target = new ResourceStreamRequestTarget(
	            new PDFResourceStream(new ByteArrayInputStream(pdf),
pdf.length));
	       target.setFileName("report.pdf");
	       
	     getRequestCycle().setRequestTarget(target);

Then no download started, if I call this code in the "on submit" of the
previous page it does works.

Any hint what is wrong with my code above?

Thanks,
Oliver
-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Redirect-after-download-a-pdf-tp3041112p3041534.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Redirect after download a pdf

Posted by Sebastian <no...@gmx.net>.
I suppose it works the other way round. You redirect to the completion 
page first which then triggers the download in the browser by another 
redirect to the PDF.

Regards,
Seb
On 13.11.2010 19:02, okrohne wrote:
>
> Hi,
>
> after a form submit I create a PDF which I send to the user with a
> ResourceStreamRequestTarget ,
> now after the user has downloaded the pdf I want  to redirect the user to a
> "completion page",
> how can I achieve that?
>
> Thanks,
> Oliver



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org