8 Replies Latest reply on Feb 15, 2008 8:26 AM by mars1412

    How to not propagate conversations??

    mschmidke

      Seam 2.0.0.GA, Facelets

      Hello,

      after a couple of months of continuous work with Seam, I today figured out that I still did not completely understand concepts of conversations and their propagation.

      I have an application with a start page (rendered using an EVENT scoped bean) and three pages which are conversation scoped. All of this three have an "Ok" and a "Cancel" button which lead back to the start page.

      Every page is embedded in a template which renders a menu on top. From that menu, you can reach any of the four pages. Clicking on the menu shall cancel the page currently displayed.

      There are three conversation scoped beans for the three pages. Any of them has a @Create @Begin method to start it's conversation. The action methods for Ok and Cancel are marked as @End.

      For the menu, I want to use rich:dropDownMenu, but have the same problem if I use s:link. I have marked every menu entry with

      <s:conversationPropagation type="end" />
      

      (or s:link with propagation="end").

      Then I put a breakpoint on bean constructor and on @Remove methods and clicked around in my menu.

      Clicking the buttons works absolutely fine. Beans are created and destroyed exactly when I expect them to be.

      But clicking around in the menu has strange results. The beans get never destroyed when expected, beans get reused sometimes and so on.

      A propagation of "none", however, works like expected. New conversations are started every time, and the old ones hang around unused until timed out. But this is not what I want - in fact, I want to cancel the conversation when the menu is selected. This isn't unusual, I think, so I am sure I am doing something completely wrong, or?


      Marcus.

        • 1. Re: How to not propagate conversations??
          brachie

          @MSchmidke: Hallo Landsmann ;-)

          my Seam app has nearly the same structure as yours (RichFaces DropdownMenu and conversational pages).
          As fas as I understood, creating new conversations and letting existing conversations timeout (this is the case when using propagation=none for menu-link) is ok and not a "bad thing". But if there is any other proper way of doing what we want (explicit end the current conversation from menu) I would also be interested in the solution.

          Greetings from Germany,

          Alexander

          • 2. Re: How to not propagate conversations??
            sztank

            Hello,
            I had the similiar situation and will be very interested in finding the right solution. Actually I stop using conversations due to the fact that it will be hard to me to understand well how they should be used in the situations like this. Although I like the concept!

            • 3. Re: How to not propagate conversations??
              pmuir

              If you want to "cancel" a conversation, use a propagation of end.

              • 4. Re: How to not propagate conversations??
                mschmidke

                 

                "pete.muir@jboss.org" wrote:
                If you want to "cancel" a conversation, use a propagation of end.


                Yes ... I tried ... but the point is that "end" does not seem to work for many of us, and I really do not understand why.

                @End annotation always works as expected, but "end" propagation does nothing understandable.

                • 5. Re: How to not propagate conversations??
                  pmuir

                  Can you show us code where it does not work?

                  • 6. Re: How to not propagate conversations??

                     

                    "MSchmidke" wrote:
                    Seam 2.0.0.GA, Facelets
                    A propagation of "none", however, works like expected. New conversations are started every time, and the old ones hang around unused until timed out. But this is not what I want - in fact, I want to cancel the conversation when the menu is selected. This isn't unusual, I think, so I am sure I am doing something completely wrong, or?


                    is this what you mean:
                    case 1)
                    • the user clicks on menu-link: 1st page is opened, 1 conversation started
                    • user clicks cancel on this page: everything ok - non conversation open

                      case 2)
                      • the user clicks on menu-link: 1st page is opened, 1 conversation started
                      • user does not click cancel in the page: conversation is still open
                      • the user clicks on menu-link again: 1st page is re-opened, 1 new conversation started, old one is still around
                      • and what you want is: when the link is clicked and there is an open conversation, the link should end the old open conversation?

                        is that what you mean?


                    • 7. Re: How to not propagate conversations??
                      mschmidke

                      Exactly! Yes!

                      • 8. Re: How to not propagate conversations??

                        I think it is possible to set the conversation id on your own (I never used it)
                        so if you click the link again and this conversation already exists, you could continue it (I think)
                        I know: that's not exactly what you want - but maybe this is also ok in your case?