title: Keep dialog open after non-ajax request
body: <p>I've got a few JSF pages having a PrimeFaces dialog to create a <code>Person</code>. Because this dialog contains a file upload I don't want to use AJAX. The dialog is to be closed when the <code>Person</code> is created. If the <code>Person</code> isn't created (validation fails or whatever) the dialog should be shown.</p>
  
  <p>I've seen people do this using <code>visible="#{not empty facesContext.messages}"</code>, I however cannot use this because the method that is called returns a <code>FacesMessage</code> in any case.</p>
  
  <p>The idea I now have is to generate a view parameter (showDialog for example) and use <code>visible="#{param.showDialog}"</code>.</p>
  
  <p>I've tried using navigation cases but since the method is called from several pages I cannot make a generic navigation case that only adds a view parameter. This would be the idea:</p>
  
  <pre><code>&lt;navigation-rule&gt;
      &lt;from-view-id&gt;*&lt;/from-view-id&gt;
      &lt;navigation-case&gt;
          &lt;from-action&gt;#{personBean.create}&lt;/from-action&gt;
          &lt;from-outcome&gt;true&lt;/from-outcome&gt;
          &lt;to-view-id&gt;#{from-view-id}&lt;/to-view-id&gt;
          &lt;redirect&gt;
              &lt;view-param&gt;
                  &lt;name&gt;showDialog&lt;/name&gt;
                  &lt;value&gt;#{form-outcome}&lt;/value&gt;
              &lt;/view-param&gt;
          &lt;/redirect&gt;
      &lt;/navigation-case&gt;
  &lt;/navigation-rule&gt;
  </code></pre>
  
  <p>Another problem with using navigation cases is that the dialog is a composite tag and the action is supplied using an attribute. When I do use a navigation case like the one above I get a message saying <code>Unable to find matching navigation case with from-view-id '/test.xhtml' for action '#{cc.attrs.saveAction}' with outcome 'true'</code>.</p>
  
  <p>I think the best/easiest solution is to add the view parameter in the method. However the requestmap is immutable and returning a String containing <code>?showDialog=true</code> doesn't work either.</p>