2 Replies Latest reply on Dec 11, 2008 4:43 PM by thokuest

    Question about conversations with pages.xml

    thokuest

      Hello everyone,


      I've got a question about how I can start and resume 'parallel' conversations. Suggest having the following components:


      1. SomeComponent:


      @Name("someComponent")
      public class SomeComponent {
           @Begin(id="interesting", join=true)
           public void doSomeInterestingStuff() {
                // ...
           }
           
           @Begin(id="moreInteresting", join=true)
           public void doSomeMoreInterestingStuff() {
                // ...
           }
           
           // [...]
      }
      



      2. SomeValueHolder:


      @Name("someValueHolder")
      @Scope(CONVERSATION)
      public class SomeValueHolder {
           private String value;
      
           public String getValue() {
                return value;
           }
      
           public void setValue(String value) {
                this.value = value;
           }
      
              // [...]
      }
      


      3. A single web page SomePage.xhtml:



      <!-- [...] -->
      
      <h:form>
        <s:button action="#{someComponent.doSomeInterestingStuff}" value="Interesting">
          <s:conversationPropagation propagation="none" />
        </s:button>
                    
        <s:button action="#{someComponent.doSomeMoreInterestingStuff}" 
            value="Even more interesting">
          <s:conversationPropagation propagation="none" />
        </s:button>
      
        <br/>
                   
                   
        <h:inputText value="#{someValueHolder.value}" />
        <h:commandButton action="none" value="OK!" />
      </h:form>
      
      <!-- [...] -->
      



      If I click on the buttons, according conversations are started or resumed. I know that


      @Begin(id= ...



      is marked as deprecated. So, the question arises, how I can achieve the same behaviour with pages.xml?


      Thanks for every advise,
      - Thomas

        • 1. Re: Question about conversations with pages.xml
          vladimir.kovalyuk

          We use Redirect component in conjunction with natural conversations to start a brand new conversation. But natural conversations is still buggy.


          Although Seam conversations were killing application for the first Seam release, Conversation API is still weak in this particular subject. There are more simple problems - for instance there isn't a simple way to not propagate conversation with rich:menuitem.


          People regularly ask those questions in the forum. There are many tickets in JIRA. For some reason this subject hasn't been a priority so far.

          • 2. Re: Question about conversations with pages.xml
            thokuest

            Thank you very much for the quick answer.



            Vladimir Kovalyuk wrote on Dec 11, 2008 14:09:


            We use Redirect component in conjunction with natural conversations to start a brand new conversation. But natural conversations is still buggy.


            Unfortunately, this is not applicable to our use case.



            Vladimir Kovalyuk wrote on Dec 11, 2008 14:09:

            ..., Conversation API is still weak in this particular subject. There are more simple problems - ...


            I tried the following configuration in pages.xml:


            <conversation name="DoSomeInterestingStuff"
                 parameter-name="interest" parameter-value="interesting" />
            <conversation name="DoSomeMoreInterestingStuff"
                 parameter-name="interest" parameter-value="moreInteresting" />
            
            <page view-id="/SomePage.xhtml">
                 <navigation from-action="#{someComponent.doSomeInterestingStuff}">
                     <begin-conversation join="true" conversation="DoSomeInterestingStuff"/>
                     <redirect />
                 </navigation>
                 
                 <navigation from-action="#{someComponent.doSomeMoreInterestingStuff}">
                     <begin-conversation join="true" conversation="DoSomeMoreInterestingStuff"/>
                     <redirect />
                 </navigation>
            </page>
            



            I thought using natural conversation would help in that particular case, but only a new 'default' conversation is started - and not resumed. By the way, what effects - or should effect - 'conversation' in the following line?


            <begin-conversation join="true" conversation="DoSomeInterestingStuff"/>
            




            Vladimir Kovalyuk wrote on Dec 11, 2008 14:09:

            People regularly ask those questions in the forum. There are many tickets in JIRA. For some reason this subject hasn't been a priority so far.


            Sounds unsatisfactory. I don't think that this use case is such an exception in a modern web application.


            Is there any workaround?


            Thanks, - Thomas