7 Replies Latest reply on Sep 22, 2008 5:38 PM by pmander

    Automatic conversation propagation

    pmander

      I thought that I would create a new thread as no one seems to be interested in my last one. I'm trying to understand why my conversations are not propagated using normal faces navigation. The only way I can get 2 pages to share the same conversation scoped object after a long-running conversation has begin is to use s:link or s:button which adds the conversationId to the next page.


      The documentation stated that conversations are propagated automatically during normal faces requests and that s:link and s:button are needed only get requests like open in new window/tab on a link.


      I simply want to show that a conversation can span a number of pages using standard h:commandButton navigation.


      Thanks


      Paul

        • 1. Re: Automatic conversation propagation
          nimo22

          h:commandButton....So you privilegue the uncomfortable way?


          Why you want to do something with more effort, if you can reach the same with less?

          • 2. Re: Automatic conversation propagation
            pmander

            Sorry I don't quite follow your cryptic response. Are you suggesting that I solve my problem in a different way? Would you care to expand on your reach the same with less solution? I am simply querying functionality in the seam manuals that states that conversations are propagated automatically across regular faces requests.


            I'm not sure what privilegue means either...

            • 3. Re: Automatic conversation propagation
              schlegel

              Hi Paul


              see the following section from the spec - perhaps it is the right answer....




              31.1.1.5. <s:conversationPropagation>
              Description
              Customize the conversation propagation for a command link or button (or similar JSF control).
              Facelets only.
              Attributes
              • type — determines the conversation propagation style: begin, join, nest, none or end.
              • pageflow — a pageflow definition to begin. (This is only useful when using
              propagation="begin" or propagation="join".)
              Usage
              <h:commandButton value="Apply" action="#{personHome.update}">
              <s:conversationPropagation type="join" />
              </h:commandButton>
              



              • 4. Re: Automatic conversation propagation
                bashan

                I think that by starting a conversation by pressing a command button (or any other control) is not such a good way. Suppose you can go to a page from several links in the application (most applications are like that), so you have to remember to put to any command link/command button a conversationPropegation control. Why no simply create the conversation in pages.xml or in the bean itself?


                It's the same thing with request parameters. Why make sure that from any link you come to a page to initialize some data. It's best to initialize the data according to a request parameter. This way, the only thing you have to remember, is passing parameter to that page...

                • 5. Re: Automatic conversation propagation
                  andre.eugenio

                  How are you redirecting the request to the other page?


                  I might be wrong but if you want just one big conversation just use a Session Scope :D


                  I saw a post other day complaining about how burden is to propagate seam conversation, but I’m really think that the current implementation is right. I usually use @Begin annotation to start a LRC (load the data) and @End to save and flush modified data, if the user click in a link that redirects to another page I don't need to worry about to end it cuz it's not propagated.


                  I had some trouble in the beginning to understand how the thing works and some code like this could help.


                  <h:outputText value="Debug Info -> Conversation ID: #{conversation.id}, 
                  Is long running? #{conversation.longRunning} />
                  
                  <rich:dataTable value="#{conversationList}" var="_entry" rendered="#{not empty conversationList}" >
                     <h:column>
                  <f:facet name="header">Id</f:facet>
                       #{_entry.id}
                       </h:column>
                       <h:column>
                       <f:facet name="header">Description</f:facet>
                       #{_entry.description}
                       </h:column>
                  </rich:dataTable>
                  



                  Hope this helps.

                  • 6. Re: Automatic conversation propagation
                    pmander

                    Thanks for the replies. The application I wanted to integrate seam into is a desktop composed of many iframes rendered in an MDI. I'm not interested in back buttons or browser history.


                    I cannot use session as this is an MDI with each iframe potentially representing a different instance of a process. I had thought that conversation scope was a great fit for this as Trinidad page flow scope is already. The difference being is that trinidad page flow scope is automatically propagated for subsequent pages.



                    • 7. Re: Automatic conversation propagation
                      pmander

                      Thanks for that but this is to customise the behaviour of a regular command function over and above its usual function which is to propagate the converstion id. I tried this and it didn't work anyway.