1 Reply Latest reply on Dec 16, 2009 2:10 PM by faffinito

    Reference parameter from pages.xml

    coldgin

      Thought I'd post this little snippet, as it wasn't the most intuitive thing to come by... If you pass a parameter from a link on one of your pages, and you want to reference the value of that parameter inside pages.xml, do the following (using the param object was the key):


      Link on the page:


      <s:link styleClass="MenuOptionText" value="#{item.label}" action="redirectToUri">
      <f:param name="targetUri" value="http://labs.jboss.com/jbossrichfaces/"/>
      </s:link>



      pages.xml:


      <rule if-outcome="redirectToUri">
      <end-conversation before-redirect="true"/>
      <redirect view-id="/uriSelectionRedirector.xhtml">
                 <param name="targetUri" value="#{param.targetUri}"/>
      </redirect>
      </rule>



        • 1. Re: Reference parameter from pages.xml

          It works great for me, except when I'm submitting a form.
          When I click on my submit button and something (i.e. the validation) fails, the request parameter is lost.
          I still didn't find a way to fix this issue.


          Any suggestion?


          F.A.