1 Reply Latest reply on Jun 24, 2008 9:08 AM by tjclifford

    menuItem click works in Seam 2.0.1.CR1 but not 2.1.0.A1 ?

    tjclifford

      We're developing a fairly simple app with Seam & richfaces with EJB3 and
      hibernate for others to emulate and are using dropDownMenu and
      menuItem for the menu.
      The menu.xhtml is called from template.xhtml:

      <h:form>
       <ui:include src="menu.xhtml"></ui:include>
      </h:form>
      


      ....and the menu.xhtml looks like this:

      
      <rich:toolBar
       xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:s="http://jboss.com/products/seam/taglib"
       xmlns:rich="http://richfaces.org/rich"
       itemSeparator="line">
      
       <rich:dropDownMenu value="Home" id="menuHome">
      
       <rich:menuItem submitMode="none">
       <s:link view="/home.xhtml" value="Home" propagation="none"/>
       </rich:menuItem>
      
       <!-- rich:menuItem submitMode="none">
       <s:link view="/myforms.xhtml" value="My Forms" propagation="none"/>
       </rich:menuItem -->
      
       <rich:menuItem submitMode="none">
       <s:link view="/pendingforms.xhtml" value="Pending Forms" propagation="none"/>
       </rich:menuItem>
      
       <!-- rich:menuItem submitMode="none">
       <s:link view="/Logout" value="Logout" propagation="none"/>
       </rich:menuItem -->
      
       </rich:dropDownMenu>
      
       <rich:dropDownMenu value="Manage Forms" id="menuManage">
      
       <rich:menuGroup value="Request Form...">
       <rich:menuItem submitMode="none">
       <s:link view="/borderchangeform.xhtml" value="Border Change Form" propagation="none"/>
       </rich:menuItem>
       </rich:menuGroup>
      
       <rich:menuGroup value="Manage Border Change Form Elements">
      
       <rich:menuItem submitMode="none">
       <s:link view="/devices.xhtml" value="Manage Devices" propagation="none"/>
       </rich:menuItem>
      
       <rich:menuItem submitMode="none">
       <s:link view="/zones.xhtml" value="Manage Zones" propagation="none"/>
       </rich:menuItem>
      
       <rich:menuItem submitMode="none">
       <s:link view="/servicetypes.xhtml" value="Manage ServiceType(s)" propagation="none"/>
       </rich:menuItem>
      
       <!-- rich:menuItem submitMode="none">
       <s:link view="/protocols.xhtml" value="Manage Protocol(s)" propagation="none"/>
       </rich:menuItem -->
      
       </rich:menuGroup>
      
       </rich:dropDownMenu>
      
       <rich:dropDownMenu value="Search Forms" id="menuSearch">
       <rich:menuItem submitMode="none">
       <s:link view="/searchborderchangeforms.xhtml" value="Border Change Forms" propagation="none"/>
       </rich:menuItem>
       </rich:dropDownMenu>
      
       <rich:dropDownMenu value="Admin" id="menuAdmin">
       <rich:menuItem submitMode="none">
       <s:link view="/formtypes.xhtml" value="Manage FormType(s)" propagation="none"/>
       </rich:menuItem>
      
       </rich:dropDownMenu>
      
      </rich:toolBar>
      
      


      The issue seems to be that if we use jsf-facelets.jar, richfaces-api.jar,
      richfaces-impl.jar, and richfaces.ui.jar from Seam v2.1.0.A1, the menu
      does work, but when we click on the menu items, the pages indicated
      will not display - the browser stays at the app's home page.

      When we use the above four mentioned jar files from Seam v2.0.1.CR1,
      the clicked links will work, and the pages display.

      We would like to use the jars from the later version, since we have
      a security object sub-system for the university we need to use, and
      the newer Seam is the only one the security object can be used with.
      (http://jira.jboss.org/jira/browse/JBSEAM-2505#action_12397905)

      The richfaces version in manifest.mf for the richfaces jars in Seam 2.1 is
      3.1.4.GA, for Seam 2.0.1 is 3.1.2.SP1.

      Has anyone experienced this issue, and might it be corrected by
      using different attributes in the menuItem tags ?

      We're using JBoss 4.2.0.GA_CP01, which has jsf-libs under the
      jboss-web.deployer directory under the deploy dir.

      I'm running JBoss Dev Studio with Win XP SP2, but my dev partner
      runs Linux desktop and he has the same issue.

      JDK is 1.5.

      Thanks.....


        • 1. Re: menuItem click works in Seam 2.0.1.CR1 but not 2.1.0.A1
          tjclifford

          After searching the web, I discovered this issue has been noticed:

          http://www.seamframework.org/Community/HowToUseSlinkInRichmenuItem
          http://jira.jboss.com:8080/jira/browse/RF-940?page=all&decorator=printable
          http://lists.jboss.org/pipermail/richfaces-issues/2007-September/000191.html
          http://jira.jboss.com:8080/jira/browse/RF-2119?subTaskView=unresolved
          http://jira.jboss.org/jira/browse/RF-2119

          So it turns out that using <s:link ....> with rich:menuItem will not work.

          Instead, I used the 'action=' attribute with the menuItem, so it looks like:

          
          <rich:toolBar
           xmlns="http://www.w3.org/1999/xhtml"
           xmlns:ui="http://java.sun.com/jsf/facelets"
           xmlns:h="http://java.sun.com/jsf/html"
           xmlns:f="http://java.sun.com/jsf/core"
           xmlns:s="http://jboss.com/products/seam/taglib"
           xmlns:rich="http://richfaces.org/rich"
           itemSeparator="line">
          
           <rich:dropDownMenu value="Home" id="menuHome">
          
           <rich:menuItem submitMode="ajax" value="Home" action="menuHome" />
          
           <rich:menuItem submitMode="ajax" value="My Forms" action="menuMyforms" />
          
           <rich:menuItem submitMode="ajax" value="Pending Forms" action="menuPendingforms" />
          
           <!-- rich:menuItem submitMode="ajax" value="Logout" action="menuLogout" / -->
          
           </rich:dropDownMenu>
          
           <rich:dropDownMenu value="Manage Forms" id="menuManage">
          
           <rich:menuGroup value="Request Form...">
           <rich:menuItem submitMode="ajax" value="Border Change Form" action="menuBorderchangeform" />
           </rich:menuGroup>
          
           <rich:menuGroup value="Manage Border Change Form Elements">
          
           <rich:menuItem submitMode="ajax" value="Manage Devices" action="menuManagedevices" />
          
           <rich:menuItem submitMode="ajax" value="Manage Zones" action="menuManagezones" />
          
           <rich:menuItem submitMode="ajax" value="Manage ServiceType(s)" action="menuManageservicetypes" />
          
           </rich:menuGroup>
          
           </rich:dropDownMenu>
          
           <rich:dropDownMenu value="Search Forms" id="menuSearch">
           <rich:menuItem submitMode="ajax" value="Border Change Forms" action="menuSearchborderchangeforms" />
           </rich:dropDownMenu>
          
           <rich:dropDownMenu value="Admin" id="menuAdmin">
           <rich:menuItem submitMode="ajax" value="Manage FormType(s)" action="menuManageformtypes" />
           </rich:dropDownMenu>
          
          </rich:toolBar>
          
          


          ....then, in pages.xml, I added:

          
           <page view-id="*">
           <navigation>
           <rule if-outcome="menuHome">
           <end-conversation/>
           <redirect view-id="/home.xhtml" />
           </rule>
           <rule if-outcome="menuPendingforms">
           <end-conversation/>
           <redirect view-id="/pendingforms.xhtml" />
           </rule>
           <rule if-outcome="menuMyforms">
           <end-conversation/>
           <redirect view-id="/myforms.xhtml" />
           </rule>
           <rule if-outcome="menuBorderchangeform">
           <end-conversation/>
           <redirect view-id="/borderchangeform.xhtml" />
           </rule>
           <rule if-outcome="menuSearchborderchangeforms">
           <end-conversation/>
           <redirect view-id="/searchborderchangeforms.xhtml" />
           </rule>
           <rule if-outcome="menuManagedevices">
           <end-conversation/>
           <redirect view-id="/devices.xhtml" />
           </rule>
           <rule if-outcome="menuManageformtypes">
           <end-conversation/>
           <redirect view-id="/formtypes.xhtml" />
           </rule>
           <rule if-outcome="menuManageservicetypes">
           <end-conversation/>
           <redirect view-id="/servicetypes.xhtml" />
           </rule>
           <rule if-outcome="menuManagezones">
           <end-conversation/>
           <redirect view-id="/zones.xhtml" />
           </rule>
           </navigation>
           </page>
          
          


          ....and this is working with the jar files from Seam 2.1.0.A1.