myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marko Asplund" <>
Subject Re: Submit form, validate input, open response in new window?
Date Fri, 30 Mar 2007 12:24:21 GMT
Simon Kitching wrote:
> The solution I ended up with was for a page to use <t:outputLink> to
> render a list of links to available documents. Each link looks like:
>  <h:outputLink value="/showDoc" target="document">
>    <f:param name="docId" value="#{}"/>
>    <t:outputText value="#{row.docName}"/>
>  </h:ouputLink>

Nice to learn about alternative ways of solving a problem you're faced
with. Thanks for posting the details Simon.

My solution ended up looking a bit different since I needed to stream
the content from a backing bean method.

the form:

<afh:body onload="if(typeof openReport != 'undefined') openReport();">
       <!-- ... -->
<h:commandButton value="doIt"

        <h:form id="reportOpener" target="report">
          <h:inputHidden value="dummy"/>
          <h:commandButton id="reportOpenerSubmit" type="submit"
          <t:div rendered="#{reportSelectionHandler.openReportWindow}">
              <script type="text/javascript">
            function openReport() {


ReportSelectionHandler backing bean:
    public void fetchReport(ActionEvent event) {
        // ...
        openReportWindow = true;

   public void downloadReport(ActionEvent event) {
	// stream content to the new browser window

i experienced some weird problems with Firefox 2.0.3 on Windows.
Sometimes the popup blocker just starts blocking the new window though
the server is on the allowed sites list. When i restart Firefox
everything works again.



View raw message