Thanks for the answers!
I got it working by setting the parameters for pdf generation to a hidden input
field that is refreshed using PPR when the dialog closes.
A ppr state listener then checks for the content of that field and simply sets
window.location to the url for the pdf servlet.
This avoids a second browser window that will just be empty anyway.
Döring Markus wrote:
You can not do this in one request because you can have either HTML (or XHTTP)
content OR PDF content in one response.
One solution to workaround this is to fire the action, close the dialog and add
an JS that submits a (hidden) button to download the PDF _after_ the dialog has
been closed.
-----Ursprüngliche Nachricht-----
Von: Stephen Friedrich [mailto:[email protected]]
Gesendet: Dienstag, 9. Dezember 2008 00:17
An: MyFaces Discussion
Betreff: [Trinidad] Generate PDF _and_ close dialog
I'd like to (well - have to) make a Trinidad (lightweight) dialog close when a
command button is clicked and at the same time create a PDF and send it in the
response.
Any idea?
Currently I can either configure the http response to be the pdf or I can close
the dialog using returnFromDialog().