You can't directly, but you can indirectly.

1) do not change the target, you need the response to come back to the
same window
2) add a onload to your body that opens a window using javascript to
the URL that points to your PDF file contents on the server

So the report would need to be saved in the user's http session, or
the user's conversation (if you are using conversations). Then you can
clear it out after if you want. Then a servlet can load the PDF from
the HTTP session and send it down (to the opened window)

On 4/18/07, wjones14 <[EMAIL PROTECTED]> wrote:

We have a page that accepts report parameters, and a button on the page that
launches the report.  The button is actually a commandLink with target =
_blank so the PDF report opens in a new window.  The button code is like
this:

<h:commandLink action="#{endOfStudyReport.createEndOfStudyPdf}"
target="_blank">
    <h:commandButton value="Generate Report" styleClass="buttonSimple"/>
</h:commandLink>

The problem is, we want to validate the parameters before launching the
report, and if there is an error, we want to re-open the parameter page with
the error message.  If no error, we want the report to open in a new window,
because it is PDF.  Does anyone know a technique for this?
--
View this message in context: 
http://www.nabble.com/validation-with-commandLink-and-target-%3D-_blank-tf3601961.html#a10061859
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Reply via email to