2 Replies Latest reply on Nov 20, 2009 6:46 PM by Wellington Martins

    Ending a Conversation (pages.xml)

    Israel Fonseca Apprentice
      Is it impossible to end a conversation in the same page that has a <begin-conversation join="true"/> in the pages.xml?
        • 1. Re: Ending a Conversation (pages.xml)
          Chris Simons Expert

          If you mean having an <end-conversation> and <begin-conversation> within the same <page> tag within your pages.xml, then the answer is YES - this will throw an error upon deployment.

          The question you should ask yourself is why you would want to both create and end a conversation on the same page.  If it is because you are arriving at this page from different sources (i.e. more than one possible page), consider beginning and ending the conversation from those pages under the <navigation> element which redirects to your page.

          For example...

          <page view-id="/home/page1.xhtml">
          <navigation from-action="#{myBean.goToPage2}">
           <begin-conversation nested="true"/>
           <redirect view-id="/home/page2.xhtml"/>
          <page view-id="/home/page2.xhtml">
           // ..

          • 2. Re: Ending a Conversation (pages.xml)
            Wellington Martins Newbie

            You may also set before-redirect to TRUE. It ends the current conversation before the page is redirect. When the redirected page starts to render its components, a new conversation is create.

            <page view-id="last.xhtml">
                    <rule if-outcome="exit">
                        <end-conversation before-redirect="true"></end-conversation>
                        <redirect view-id="first.xhtml"></redirect>