3 Replies Latest reply on Feb 17, 2008 2:52 PM by pmuir

    Correct way to start conversation

    alllle

      Given the many options I can use to start a new conversation, I am still not sure what is the correct way for my situation.

      I have a page that shows the summary info, no long-running conversation. It contains a <s:link> to a editing page that should starts a long-running conversation. In addition, when this page is created, it needs to perform an action to load the object from the database for editing. I have tried the following ways but they all have some problem:

      Method 1: in the <s:link>, besides specifying view ID, I also specify an action that is annotated with @Begin to start a conversation, which loads the data from the DB. <s:link> propagation set to "join".
      Problem:
      Refreshing the resulting page causes a new conversation been created instead of reusing the one just created.

      Method 2: in the pages.xml file for the view, I specify the <start-conversation> tag. I also specify an action="" attribute to trigger loading of the data from the DB. propagation set to "join".
      Problem: :
      Each time the view is accessed, it reloads the data from DB , even for ajax calls.
      Refreshing page causes new conversation to start, ajax calls are fine.

      What I want is when the view is access the first time, create the conversation, load the data from the DB. However, using the existing conversation when the page is refreshed. What is the proper way to achieve this in seam?

        • 1. Re: Correct way to start conversation

          On your method annotated with @Begin, do you have @Begin(join=true)? I know you have join on the s:link but I think it needs to be on the @Begin annotation.

          • 2. Re: Correct way to start conversation
            alllle

             

            "EricJava" wrote:
            On your method annotated with @Begin, do you have @Begin(join=true)? I know you have join on the s:link but I think it needs to be on the @Begin annotation.


            Yes, I did have join=true. I think the things I mentioned about @Begin, like always start conversation if void type method and never start conversation if return null, does not care if the join is set to true or false.

            • 3. Re: Correct way to start conversation
              pmuir

              Put propagation="begin" on the s:link or begin-conversation on the navigation in pages.xml