2 Replies Latest reply on Mar 23, 2008 8:26 AM by Kenneth Christensen

    seam action and after page action

    Dean Hiller Expert

      I am a beginner so this should be an easy question....


      I have started stepping through the code investigating a problem with my app.  Here is one pages.xml version I explore....


           <page view-id="/web/login/userregister.xhtml" >
              <navigation>     
                  <rule if="#{userManagerDo.registered}">
                      <redirect view-id="/web/login/previewHtml.xhtml"/>
                  </rule>          
              </navigation>
           </page>



      I notice that the if is evaluated after I click register on the userregister.xhtml page.  Then I change my pages.xml to the following....



           <page view-id="/web/login/userregister.xhtml" 
                     action="#{login.getLoginPage}">
              <navigation>
                  <rule if="#{userManagerDo.registered}">
                      <redirect view-id="/web/login/previewHtml.xhtml"/>
                  </rule>          
              </navigation>
           </page>



      This is where my real mess begins.  Now, I notice seam starts to execute the userManagerDo.registered BEFORE the userregister.xhtml page is even rendered.  It is trying to match the rule to the outcome of the newly added action.  This dual use of the rules is confusing.  It seems that I can use a rule for outcomes of actions and also for outcomes matching a page, is that correct?  Do I understand that correctly or am I missing something?  I stepped through the seam code and I am just wondering if I misunderstood the code?
      thanks,
      Dean