Hi,

Also see ResourceLink and DownloadLink components.
Since you want to show the file in the browser you will have to set the
Content-Disposition response header to 'INLINE'.

You talk about form submit, so you may need to use (Ajax)SubmitLink with
target="_blank" on its <a> or a Button but then the target="_blank" should
be on the <form>.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Feb 28, 2017 at 7:53 AM, Ernesto Reinaldo Barreiro <
[email protected]> wrote:

> if your link point to the generated resource e.g. /resources/mypdf?id=xxxx
> and you add target="_blank" that should be do it. See
>
> http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/
>
>
>
> On Mon, Feb 27, 2017 at 9:56 PM, SeldonCrisis <[email protected]> wrote:
>
> > Hey guys, I'm pretty new to Wicket and need some help. I've read through
> > the
> > forums and found this question answered twice, but I'm still confused. I
> > want to display a PDF in a new tab after having clicked a button (in the
> > onSubmit event). How do I go about doing this? So far I understand that I
> > must create my own custom resource that extends ByteArrayResource. So do
> I
> > override getData() to define the actual data in the ByteArrayStream? And
> > how
> > do I then go about actually responding with the resource in the event
> > handler? I'm sorry if my question is too general/confusing. If you could
> > just link me to an example/document that illustrates how to accomplish
> > this,
> > it would more than suffice.
> >
> > Thanks
> >
> > --
> > View this message in context: http://apache-wicket.1842946.
> > n4.nabble.com/Display-PDF-in-new-tab-tp4677202.html
> > Sent from the Users forum mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> >
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
>

Reply via email to