5 Replies Latest reply on Jul 21, 2006 4:10 AM by petekol

    how to start new conversation, new nested conversation and c

    petekol


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


      @Begin(nested=true)
      m2() {
      some code here;
      create component here that belongs to nested conversation;
      }

      does not create nested conversation, should it?

        • 1. Re: how to start new conversation, new nested conversation a
          petekol

          the root of the problem i have is

          1) why bean2 is created when the page is rendered first time indepandantly from rendered property
          2) why click on m1 does not create conversation + nested conversation
          3) i do not know how to instanciate new bean2 in nested conversation

          bean1:

          showBean2 = false;

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

          @Begin(nested=true)
          m2() {
          some code here;
          create bean2 here that belongs to nested conversation;
          }

          bean2:

          @Begin(join=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>

          • 2. Re: how to start new conversation, new nested conversation a
            gavin.king

            Conversations begin and end at request boundaries. You cannot create two new conversations during a single request.

            • 3. Re: how to start new conversation, new nested conversation a
              petekol

              so, a single request can not create new conversation with nested one, right?

              may be this annotation should do it @Begin(join=true, nested=true)? -)
              the problem i have then is how to say in what conversation a new beans go....

              • 4. Re: how to start new conversation, new nested conversation a

                 

                "petekol" wrote:
                so, a single request can not create new conversation with nested one, right?

                Right. You'll need to call your @Begin(nested=true) in a new request to get your nested conversation.

                • 5. Re: how to start new conversation, new nested conversation a
                  petekol

                  how can i put bean2 in to nested context after a user press m1,m3 buttons so that the bean is read-write?


                  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>