7 Replies Latest reply on Jul 27, 2006 10:30 AM by petekol

    nested conversation kills its parent if id is specified

    petekol

      @Begin(id="newEmp", nested = true, ifOutcome = "newPage")
      kills it's parent conversation and creates two new conversations where newEmp is a root one.

      @Begin( nested = true, ifOutcome = "newPage") works without problems.....

      could it be a bug?

        • 1. Re: nested conversation kills its parent if id is specified
          petekol

           

          "petekol" wrote:
          @Begin(id="newEmp", nested = true, ifOutcome = "newPage")
          kills it's parent conversation and creates two new conversations where newEmp is a root one.

          @Begin( nested = true, ifOutcome = "newPage") works without problems.....

          could it be a bug?


          sorry, seam does not kills a parent one, but rearange ids and contexts that leads to wrong result

          • 2. Re: nested conversation kills its parent if id is specified
            petekol

            in ConversationInterceptor.endOrBeginLongRunningConversation getOutcomeForConversationId is called before beginConversationIfNecessary that is wrong because it calls updateCurrentConversationId on old conversation.

            so i shifted beginConversationIfNecessary(method, result); up and it works now.

            anyway, interesting conversation with myself...... -(

            • 3. Re: nested conversation kills its parent if id is specified
              gavin.king

              It is almost always wrong to use a constant conversation id in @Begin. Have you actually properly understood the use of id in @Begin?

              • 4. Re: nested conversation kills its parent if id is specified
                petekol

                 

                "gavin.king@jboss.com" wrote:
                It is almost always wrong to use a constant conversation id in @Begin. Have you actually properly understood the use of id in @Begin?


                Yes, I hope I understand it -), in this case it is for modal action of creating a new entity but for test purpose anyway.

                Can you give me a tip how I can control the instantiation of beans on a page and in what conversation contexts they go? At the moment all beans that mentioned on a page in EL get created for current conversation?..
                The problem I have is that I would like to have many conversations/nested running on one page. I think it is where Seam limits visual design at the moment


                • 5. Re: nested conversation kills its parent if id is specified
                  gavin.king

                  All beans instantiated during a conversation go into the current (ie. most nested) conversation.

                  • 6. Re: nested conversation kills its parent if id is specified
                    petekol

                     

                    "gavin.king@jboss.com" wrote:
                    All beans instantiated during a conversation go into the current (ie. most nested) conversation.

                    it is clear -)

                    bean1:

                    showBean2 = false;

                    @Begin(join=true)
                    m1() {
                    some code here;
                    showBean2 = true;
                    }

                    bean2:

                    @Begin(nested=true)
                    m3() {
                    some code here;
                    }


                    index.xhtml

                    <h:form>
                    <h:commandLink value="m1" action="#{bean1.m1}" class="button" />
                    </h:form>

                    <h:form rendered="#{bean1.showBean2}"
                    <h:commandLink value="m3" action="#{bean2.m3}" class="button" />
                    </h:form>

                    after a user press m1 button both beans go in new conversation.
                    i would like bean2 be in nested when a user press m3 after pressing m1



                    • 7. Re: nested conversation kills its parent if id is specified
                      petekol

                      sorry that i am a bit noisy here -)
                      how can a button/link end a nested conversation (by execution of a method with @end) and then execute some method (refresh) in parent conversation in elegant way?