6 Replies Latest reply on May 12, 2006 1:39 PM by g.tomassoni

    resume parent conversation in @End method

    baz

      Hello,
      i'd like to resume a parent conversation after executing a method annotated with @End
      I have read the forum and have found some threads about similar topics.

      And i have found in the CVS version of seam that there is the method redirectToParent implemented.
      This function resumes the parent conversation of the current conversation. But it does not end a conversation.
      And it can't be used in method annotated with @End because it pops the conversation stack.
      What i really need is either of this:

      @End (redirecttoParent=true)
      public String method(){
      ...
      return null;
      }
      or this
      @End
      public String method(){
      ...
      return Seamconstant.REDIRECTTOPARENT;
      }



        • 1. Re: resume parent conversation in @End method
          gavin.king

          Add a feature request to JIRA.

          • 2. Re: resume parent conversation in @End method
            baz

            Feature request done

            simple Use Case for this feature:
            The user is fills out a form (in the outer conversation). He detets that i must retrieve some information. So he does this (in the nested converstaion). After that he can continue editing his form. All this without switching windows.
            The retrival of the same information can occur at different pages.

            My use case is more difficult than the above. If someone is interested in it, i am willing to describe it.
            Ciao,
            Carsten Hoehne

            • 3. Re: resume parent conversation in @End method
              baz

              Gavin was so kind to implement a method called endAndRedirect
              Thanks for that.

              This can be used like this:

               public String saveProtocol() {
              // the meat of the method not copied.
               return Conversation.instance().endAndRedirect();
               }
              

              This ends the current conversation (deleting it from the conversationstack and the conversationlist) and redirects to the ViewId of the parent conversation.

              If there is no parent conversation endAndRedirect returns 'null' what results in redisplaying the current page.

              Do not annotate such a method with @End. This results in an empty conversationstack after execution of endAndRedirect.
              Ciao,
              Carsten

              • 4. Re: resume parent conversation in @End method
                g.tomassoni

                This is an interesting new feature.

                Do you think there would be any usefulness in enhancing it (or perhaps extending it) to the case in which one is "popping and redirecting" from the topmost conversation?

                I guess it could be usefull in many cases. In example, a logon issued by a login interceptor could start a conversation which, when ended, resumes to the point were it was started. This would get a "logon on demand" function implementation simpler, in example.

                I mean, the "conversation return point" should be saved in the conversation itself, not in its parent conversation. This would allow a non-null return value when ending and redirecting the topmost conversation.

                • 5. Re: resume parent conversation in @End method
                  gavin.king

                  Check the issue tracker example. It already does this :-)

                  • 6. Re: resume parent conversation in @End method
                    g.tomassoni

                    Great! Gonna try it!

                    Thanks,