0

I've got the requirement that one click of the command button will refresh the current page and open another tab, window, or browser to view PDF file at same time using JSF and Primefaces. And I'm using jasper report to generate PDF.

Dylan Wheeler
  • 6,928
  • 14
  • 56
  • 80
Amit Kammar
  • 29
  • 1
  • 8

1 Answers1

0

With commandLink you could use attribute

target="_blank"

and

action="#{myBean.showPdfInNewTab()}"

and

update="idOfElementToUpdate"

or

update="@all"

which I have never tried. Summary:

<p:commandLink action="#{myBean.showPdfInNewTab()}" target="_blank" value="Click me" update="@all" />

PDF handling: PDF handling by BalusC

opfau
  • 731
  • 9
  • 37
  • Thank you i'll try this and let you know. – Amit Kammar May 15 '15 at 12:21
  • This solution i implemented in my code but it is not working according to my requirement. The current page is refreshing but at the same time it is not opening another tab to view PDF file. – Amit Kammar May 16 '15 at 05:35