0

I'm using this example by Ulrich Krause http://www.eknori.de/2011-10-25/xpages-to-pdf-with-itext/

And it works great but when you have clicked on the button the PDF is returned to the user. Any SSJS clicks is dead on the page for a while. Like a timeout, Any ideas how to I fix it ?

pipalia
  • 911
  • 1
  • 12
  • 46
Fredrik Norling
  • 3,461
  • 17
  • 21

1 Answers1

2

I would move the code onto its own xpage into the beforeRenderResponse event and use the button to open that page (eventually in its own window?). This way you don't need to high-jack the response of the page you want to continue to use.

stwissel
  • 20,110
  • 6
  • 54
  • 101
  • I have thought of that but don't I get an orphen window then. That the user have to close? – Fredrik Norling May 29 '12 at 18:24
  • If you don't open a new window, but just open the URL then you don't get an orphan window. Of course since it is PDF you could define "inline" instead of "attachment" and the PDF would open in that window. --> Depends on the user expectation. If the main purpose is to have something to print that's good. If they want download it is an extra step. In any case "Open a new URL" is the way to go – stwissel May 30 '12 at 02:33