2 Replies Latest reply on May 18, 2009 8:28 PM by kairos

    conversation propagation and rich:dropDownMenu

      Hello,


      I have some questions and problems concerning the conversation concept together with menu navigation.


      I use the seam-gen generated menu.xhtml for navigation to the various parts of my application. Worked fine using

      <s:link>

      together with
      propagation=none

      in the way that no cid will be generated as a request parameter.
      As the application is growing, I replaced part of the links with a rich:dropDownMenu.


      <h:form>
           <rich:toolBar>
               <rich:toolBarGroup location="left">
                   <h:outputText value="#{projectName}:"/>
                   <s:link view="/home.xhtml" value="Home" propagation="none"/>
                  </rich:toolBarGroup>
               <rich:dropDownMenu id="myMenu" value="#{messages.myMenu}">
                   <rich:menuItem value="#{messages.myObjects}" action="ObjectList"/>
               </rich:dropDownMenu>
           </rich:toolBar>
      </h:form>
      



      Now I define the navigation in pages.xml like:


          <page view-id="*">
              <navigation>
                  <rule if-outcome="ObjectList">                 
                       <redirect view-id="/objectList.xhtml"/>
                  </rule>
              </navigation>
          </page>
      



      If I now choose the ObjectList menu item, a cid will be generated as a request parameter. Furthermore, if I am inside a long running conversation and click on the ObjectList, that same cid will be reused.


      How can I avoid the conversation generation and propagation when using dropDownMenu?


      And another question: Is there a possibility to define propagation=none in pages.xml? I use this file for all other navigation except for the links in menu.xhtml because I don't know how to define that conversation should not be propagated.


      Thanks

        • 1. Re: conversation propagation and rich:dropDownMenu

          Andreas Marx wrote on May 12, 2009 18:46:



          And another question: Is there a possibility to define propagation=none in pages.xml?



          Yes, there seems to be a way. Please vote to improve it: JBSEAM-1296. (The workaround is described in the linked JIRA issue)



          I use this file for all other navigation except for the links in menu.xhtml because I don't know how to define that conversation should not be propagated.



          Remember that for the menus to work correctly you may also need to stop parameter propagation with includePageParams="false".  I wonder if the same trick use for propagation=none works to define  includePageParams="false" in pages.xml



          Thanks

          • 2. Re: conversation propagation and rich:dropDownMenu

            Thanks,


            I tried everything you told and a lot more and the result is that I am getting more and more confused on how conversation propagation (cp) works.


            First question: as I understand, cp takes only place in case of long running conversations? Is this assumption correct?


            If so, I don't understand the following behaviour: I use standard seam login page:


            <h:form id="login">
              <rich:panel>
                <f:facet name="header">#{messages.titleLogin}</f:facet>
            
                <p>#{messages.loginText}</p>
                           
                <s:decorate id="usernameField" template="layout/complexEdit.xhtml">
                 <ui:param name="width" value="200px" />
                 <ui:define name="label">#{messages.userLoginName}</ui:define>
                 <h:inputText id="username" required="true" value="#{credentials.username}"/>
                </s:decorate>
                <s:decorate id="passwordField" template="layout/complexEdit.xhtml">
                 <ui:param name="width" value="200px" />
                 <ui:define name="label">#{messages.userPassword}</ui:define>
                 <h:inputSecret id="password" required="true" value="#{credentials.password}"/>
                </s:decorate>
                
                <div style="clear:both"/>
              </rich:panel>
            
              <div class="actionButtons">
               <h:commandButton value="#{messages.bLogin}" action="#{identity.login}"/>
              </div>
            </h:form>
            



            together with login.page.xml like:


             <navigation from-action="#{identity.login}">
              <rule if="#{identity.loggedIn}">
               <redirect view-id="/main.xhtml"/>
              </rule>
             </navigation>
            



            If the login-button is pressed, the following url is generated:


            http://localhost:8080/trainSched/main.seam?cid=3
            



            I thought, that there is no long running conversation when executing the identity.login action. Why exists the cid in the url. I tried the following to eliminate the cid:


            <s:converationPropagation type="none"/>
            


            inside the h:commandLink. No success.


            include-page-params = "false"
            



            in the redirect rule. No success.


            Now I wanted to see if the cid is propagated on any h:commandLink. I added such a link to the toolbar (see my first post) which points to the objectList.xhtml. I supposed that a cid would be generated but that doesn't happen.


            I would really appreciate any help that casts some light on conversation propagation.


            Thanks