9 Replies Latest reply on Jun 8, 2008 2:09 PM by Stan Silvert

    rich:PanelMenuItem not working with JSFUnit

    Tim Evers Master

      Hi,

      I'm trying to write a JSFUnit test for a page that has a rich:panelMenu on it.
      But nothing I try actually works when it comes to clicking on the rich:panelMenuItem(s).

      the xhtml part.

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:c="http://java.sun.com/jsp/jstl/core"
       xmlns:fn="http://java.sun.com/jsp/jstl/functions"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:a4j="http://richfaces.org/a4j"
       xmlns:s="http://jboss.com/products/seam/taglib"
       xmlns:rich="http://richfaces.org/rich">
      
       <h:form>
       <rich:panelMenu id="SideMenu" styleClass="SidePanelMenu"
       expandSingle="true"
       >
       <rich:panelMenuGroup id="mainMenu" label="Search" iconCollapsed="/images/search_icon.gif"
       iconExpanded="/images/search_icon.gif" >
       <rich:panelMenuItem label="General" action="#{temp.test}" />
       <rich:panelMenuItem id="gotoTenureSearch" label="Tenure" action="#{tenureSearchCtrl.openTenureSearch}" />
       <rich:panelMenuItem label="Certificate" action="#{temp.test}" />
       <rich:panelMenuItem id="gotoUserSearch" label="User" action="#{userSearchController.gotoUserSearch()}" />
       <rich:panelMenuItem label="Customer" action="#{temp.test}" />
       </rich:panelMenuGroup>
      
       <rich:panelMenuGroup label="Certificates"
       iconCollapsed="/images/cert_icon.gif"
       iconExpanded="/images/cert_icon.gif"
       binding="#{CertificatesMenuPanelBinding.certificatesGroup}"
       >
      
       </rich:panelMenuGroup>
      
       <rich:panelMenuGroup label="General Ledger"
       iconCollapsed="/images/gl_icon.gif"
       iconExpanded ="/images/gl_icon.gif"
       >
       <rich:panelMenuItem label="Reconciliation" action="#{temp.test}">
       <f:param name="v" value="nothing" />
       </rich:panelMenuItem>
       <rich:panelMenuItem label="Journalling" action="#{temp.test}">
       <f:param name="v" value="nothing" />
       </rich:panelMenuItem>
       <rich:panelMenuItem label="Financial Mapping" action="#{temp.test}">
       <f:param name="v" value="nothing" />
       </rich:panelMenuItem>
       </rich:panelMenuGroup>
      
       <rich:panelMenuGroup label="Reporting"
       iconCollapsed="/images/reporting_icon.gif"
       iconExpanded ="/images/reporting_icon.gif"
       >
       <!-- For this, probably want to populate
       report list dynamically? -->
       <rich:panelMenuItem label="Report #1" action="#{temp.test}">
       <f:param name="v" value="nothing" />
       </rich:panelMenuItem>
       <rich:panelMenuItem label="Report #2" action="#{temp.test}">
       <f:param name="v" value="nothing" />
       </rich:panelMenuItem>
       </rich:panelMenuGroup>
      
       <rich:panelMenuGroup label="Add New"
       iconCollapsed="/images/add_icon.gif"
       iconExpanded ="/images/add_icon.gif"
       >
      
       <rich:panelMenuItem label="Customer" action="#{temp.test}">
       <f:param name="v" value="nothing" />
       </rich:panelMenuItem>
       <rich:panelMenuItem label="Proposal" action="#{temp.test}">
       <f:param name="v" value="nothing" />
       </rich:panelMenuItem>
       <rich:panelMenuItem label="Tenure" action="#{temp.test}">
       <f:param name="v" value="nothing" />
       </rich:panelMenuItem>
       </rich:panelMenuGroup>
      
       <rich:panelMenuGroup label="Administration"
       iconCollapsed="/images/admin_icon.gif"
       iconExpanded ="/images/admin_icon.gif"
       >
       <!-- For this, probably want to populate
       report list dynamically? -->
       <rich:panelMenuItem label="Codes" action="#{temp.test}">
       <f:param name="v" value="nothing" />
       </rich:panelMenuItem>
       <rich:panelMenuItem label="Security" action="#{temp.test}">
       <f:param name="v" value="nothing" />
       </rich:panelMenuItem>
       </rich:panelMenuGroup>
      
      
      
       <rich:panelMenuGroup label="Development Helpers">
       <rich:panelMenuItem label="Current User Context" action="#{DevCntl.dumpCurrentUser}" />
       <rich:panelMenuItem label="Seam Debug" action="#{DevCntl.seamDebug}" />
       <rich:panelMenuItem id="gotoTagReference" label="Tag Reference" action="/egServices/tags/gekkoTagReference.xhtml" />
       <rich:panelMenuItem label="Examples" action="/egServices/examples.xhtml" />
       <rich:panelMenuItem label="Steve Scratch" action="/scratch/swf/home.xhtml" />
       </rich:panelMenuGroup>
       </rich:panelMenu>
      
       </h:form>
      </ui:composition>
      


      In the JSFUnit test I have tried using a RichFacesClient, a JSFClientSession, and a SeamClient and none of them work with the clickCommandLink. How am I supposed to click these menu items?

      Thanks