title: Implementing a commandButton that returns to the previous page
body: <p>What I want to do is implement a JSF page that will return to the prior page once it is done.  This is with @RequestScoped beans. </p>
  
  <p>The original page called <strong>viewDocument.xhtml</strong> has this:</p>
  
  <pre><code>&lt;f:metadata&gt;
      &lt;f:viewParam name="ID" value="#{viewDocument.id}" /&gt;
  &lt;/f:metadata&gt;
  
   (bunch of stuff)
  
  &lt;h:link outcome="editThingy" value="Edit Thingy"&gt;
      &lt;f:param name="ID" value="#{viewDocument.doc.id}" /&gt;
      &lt;f:param name="Return" value="viewDocument" /&gt;
  &lt;/h:link&gt;
  </code></pre>
  
  <p>The target page <strong>editThingy.xhtml</strong> has its own backing bean, and looks like this:</p>
  
  <pre><code>&lt;f:metadata&gt;
      &lt;f:viewParam name="ID" value="#{editThingy.id}" /&gt;
      &lt;f:viewParam name="Return" value="#{editThingy.navReturn}" /&gt;
  &lt;/f:metadata&gt;
  
  &lt;h:form&gt;
  
     (bunch of stuff)
  
     &lt;p:commandButton value="Save" action="#{editThingy.save}" &gt;
        &lt;f:param name="ID" value="#{editThingy.id}" /&gt;
     &lt;/p:commandButton&gt;
     &lt;p:commandButton value="Cancel" action="#{editThingy.navReturn}" &gt;
         &lt;f:param name="ID" value="#{editThingy.id}" /&gt;
     &lt;/p:commandButton&gt;
  
  &lt;/h:form&gt;
  </code></pre>
  
  <p>The idea is that both buttons (cancel or save) would return to the page indicated by the <strong>Return</strong> request parameter, with the new page getting the ID request parameter so it pulls up the same record that <strong>EditThingy</strong> worked on.</p>
  
  <p>BZZZT!  The <strong>p:commandButton</strong> does a POST and not a GET, so it can't use <strong>f:param</strong>. However if I try to use <strong>p:button</strong> there is no attribute to call the backing bean!   </p>
  
  <p>Is there any way to implement what I want?</p>