5 Replies Latest reply on Jun 28, 2007 1:29 PM by youngm

    actions defined in pages.xml

    youngm

      I'm attempting to get the hang of pages.xml. If I do:

       <page view-id="/list.xhtml">
       <navigation if-outcome="detail">
       <render view-id="/detail.xhtml"/>
       </navigation>
       </page>
       <page view-id="/detail.xhtml" action="#{bean.loadDetail}"/>
      


      When I navigate from /list.xhtml to /detail.xhtml the #{bean.loadDetail} expression is never called. However if I just hit /detail.xhtml directly the action is called. Is this a bug or expected behaviour of some sort?

      Mike

        • 1. Re: actions defined in pages.xml
          delphi'sghost

          I forget what the difference is between render and redirect, but I usually use redirect in pages.xml.

          
           <page view-id="/list.xhtml">
           <navigation if-outcome="detail">
           <redirect view-id="/detail.xhtml"/>
           </navigation>
           </page>
           <page view-id="/detail.xhtml" action="#{bean.loadDetail}"/>
          
          


          Give that a whirl...


          • 2. Re: actions defined in pages.xml
            youngm

            Unfortunately I don't want to do a redirect here because I'm passing some other request parameters in and they get dropped after the redirect???

            • 3. Re: actions defined in pages.xml
              gavin.king

               

              "youngm" wrote:
              I'm attempting to get the hang of pages.xml. If I do:

               <page view-id="/list.xhtml">
               <navigation if-outcome="detail">
               <render view-id="/detail.xhtml"/>
               </navigation>
               </page>
               <page view-id="/detail.xhtml" action="#{bean.loadDetail}"/>
              


              When I navigate from /list.xhtml to /detail.xhtml the #{bean.loadDetail} expression is never called. However if I just hit /detail.xhtml directly the action is called. Is this a bug or expected behaviour of some sort?

              Mike


              Um, it should work, I think...

              • 4. Re: actions defined in pages.xml
                youngm

                There was an error in my example it should actually be:

                 <page view-id="/list.xhtml">
                 <navigation>
                 <rule if-outcome="detail">
                 <render view-id="/detail.xhtml"/>
                 </rule>
                 </navigation>
                 </page>
                 <page view-id="/detail.xhtml" action="#{bean.loadDetail}"/>
                


                But that doesn't work either....I'll file a bug.

                • 5. Re: actions defined in pages.xml
                  youngm