2 Replies Latest reply on Apr 17, 2008 10:05 AM by lucky fin

    One conversation for one page

    lucky fin Newbie

      Hi,


      I've an application in which each page represents an atomic functionality. And the state of the content of the pages have to be persistent and independent.


      I would to start a different conversation for each page.


      I've made it in pages.xml with a natural conversation, then I've declared this conversation in my page tag:


      (sorry, I can't copy correctly the xml )


      in pages.xml


      conversation name test  parameter-name testId parameter-value 1


      page view-id /test.xhtml conversation test
      begin-conversation
      page     


      then I have an action (conversation scoped) listener that join this conversation in it's create method


           @Create
           @Begin(join true)
           public void init()


      now it works fine at the first access to the test.xhtml page, but at the second I get an exception because I'm tring to begin a conversation already begun.


      There is a way to solve this problem? I can make a conditional begin-conversation, so if the conversation is already begun I can join and not create it?
      There is a better way to reach this result?


      Thanks in advanced
      Luc

        • 1. Re: One conversation for one page
          Andy Gibson Novice

          I think (I can't tell since it is hard to make out what your pages.xml is) that you need to put join=true on your begin-conversation :


          <page view-id="/test.xhtml" conversation="test">
            <begin-conversation join="true"/>
          </page>
          
          



          Btw, '=' can be entered by escaping it with '\' such as '\='


          • 2. Re: One conversation for one page
            lucky fin Newbie

            I've tried it, but in this case (using the seam debug page), I see that


            if I access the test page, I see correctly it's data in it's conversation,


            if I access the test1 page (configured for conversation
            test 1), I see only the second conversation active and in this all the data of the first and second conversation togheter!


            So I see always one conversation active with all the data of the all previous used conversation inside!


            This does not happen without join=true in the pages.xml, but I have the exception if I visit the test(i) page more than one time


            any suggestion?


            Thanks a lot
            Luciano