I don't get the problem?
public void downloadPdf() {
generatePdf(); // First generate PDF file.
...
// Proceed to download.
}
I'am using the technics described in
http://forum.java.sun.com/thread.jspa?threadID=5130404
and
http://forum.java.sun.com/thread.jspa?threadID=5128921
In particular my button for displaying existing documents in a new window looks like
<ui:button
action="#{MyBean.buttonDocumentShow_action}"
binding="#{MyBean.buttonDocumentShow}"
id="buttonDocumentShow"
onClick="this.form.target = '_blank'; window.setTimeout('document.getElementById(\'' + this.form.id + '\').target = null;', 50);"
text="#{akt.button_show}"/>