2 Replies Latest reply on Feb 17, 2009 4:14 PM by gerry365

    Navigation rule for a Parameterized method

      Does anyone know why my navigation rules no longer works after I parameterized the 'from-action' method? The only way I can get the rules to work is by moving them out of the action-specific navigation element into a global navigation element.

      This navigation rule no longer works but it used to, before I parameterized the processUser method:

      <navigation from-action="#{UserDetails.processUser}">
          <rule if-outcome="success">
              <redirect view-id="/confirmation.xhtml"></redirect>
          </rule>
          <rule if-outcome="failure">
              <redirect view-id="/userDetails.xhtml"></redirect>
          </rule>
      </navigation>


      This is how I have overcome the problem by moving the rules into the global navigation element:

      <navigation>
          <rule if-outcome="success">
              <redirect view-id="/confirmation.xhtml"></redirect>
          </rule>
          <rule if-outcome="failure">
              <redirect view-id="/userDetails.xhtml"></redirect>
          </rule>
      </navigation>


      Just to complete the picture, here's the action link from my User.xhtml page and the backing bean method:

      <h:commandLink action="#{UserDetails.processUser('SOM')}" />

      UserDetails.processUser(String type);
        • 1. Re: Navigation rule for a Parameterized method
          sanghakanwar

          try -


          <navigation from-action="#{UserDetails.processUser('SOM')}">
              <rule if-outcome="success">
                  <redirect view-id="/confirmation.xhtml"></redirect>
              </rule>
              <rule if-outcome="failure">
                  <redirect view-id="/userDetails.xhtml"></redirect>
              </rule>
          </navigation>

          • 2. Re: Navigation rule for a Parameterized method
            Thanks. It works, although not as compact as the form I imagined it should have been:

            <navigation from-action="#{UserDetails.processUser()}"> 
                <rule if-outcome="success"> 
                    <redirect view-id="/confirmation.xhtml"></redirect> 
                </rule> 
                <rule if-outcome="failure"> 
                    <redirect view-id="/userDetails.xhtml"></redirect> 
                </rule>
            </navigation>