0 Replies Latest reply on Jun 19, 2009 4:07 PM by nhieb

    s:button and page actions

    nhieb

      Hello everybody.
      I faced situation that intrigued me and i am wondering if someone can explain to me what is going on.
      I have a page


      page1.xhtml



      , that contains number of buttons and links.




      <s:button  
      value="Button 1" 
      action="myPageAction"/>
      
      <s:button 
      value="Button 2" 
      view="page2.xml"
      action="myPageAction"/>
      
      <h:commandButton 
      value="Button 3" 
      action="myPageAction"/>
      
      <h:commandLink value="Link 1"
      action="#{someBean.someMethodWithOutcome}"/>
      
      <s:link action="#{someBean.someAction}"
      view="/page2.xhtml"
      value="Link 2"/>
      
      <s:link action="myPageAction"
      value="Link 3"/>
      



      And in pages.xml i have a page action defined for page1.xhtml and a nvaigation rule



      <page view-id="*">
           <navigation>
           <rule if-outcome="myPageAction">
                <redirect view-id="/page2.xhtml"/>
           </rule>
      </navigation>
      
      <page view-id="/page1.xhtml" 
      login-required="true" 
      action="#{someOtherBean.someAction}">
      <restrict/>
      <end-conversation/>
      </page>




      So now, when i click Button 1 or Link 3, page action myPageAction from pages.xml(someOtherBean.someAction) is called (i can see it is in the logs), and then i am redirected to page2.xhtml
      However, in all other cases (especially interesting- for Button 2 and Link 2) clicking will not cause page action to be triggered, and i am directed to page2 without someOtherBean.someAction being executed


      Wondering f anyone can explain such behaviour