1 Reply Latest reply on Apr 10, 2010 2:46 PM by pjot

    rule-if logic not occuring


      Anyone seen this before?  Seam 2.2.0.GA...


      The evaluation is certainly true, but the first outcome never redirects as needed.


      Does anyone see what is going wrong here?  Thanks.


       <page view-id="/login.xhtml">
           <navigation from-action="#{identity.logout}">
                  <redirect view-id="/home/home.xhtml"/>
              </navigation>
      
              <navigation from-action="#{identity.login}" evaluate="#{currentUser.firstLogin}">
                  <rule if-outcome="true">
                      <redirect view-id="/pm/pds/wizard/profileWizard.1.xhtml"/>
                  </rule>
                  <rule if-outcome="false">
                      <redirect view-id="/home/home.xhtml"/>
                  </rule>
              </navigation>
           </page>



        • 1. Re: rule-if logic not occuring
          pjot

          Hi, if your #{currentUser.firstLogin} expression returns boolean true/false  it would not work since the outcome of the rule

          s if-outcome clause is expecting a String. Rewrite your firstLogin method to return a String "true"/"false" or outject some boolean value to, for example, event scope and evaluate it in rule

          s if clause:


          @Out(scope=EVENT)
          private boolean firstLogin = false;
          
          public void firstLogin()
          {
             if(foo)
               firstLogin = true;
             else
               firstLogin = false;
          }



          and in the pages.xml :



                  <navigation from-action="#{identity.login}" evaluate="#{currentUser.firstLogin}">
                      <rule if="#{firstLogin}">
                          <redirect view-id="/pm/pds/wizard/profileWizard.1.xhtml"/>
                      </rule>
                      <rule if="#{!firstLogin}">
                          <redirect view-id="/home/home.xhtml"/>
                      </rule>
                  </navigation>
          



          otherwise use set/getter for member firstLogin and dont outject it to any scope