1 Reply Latest reply on Apr 25, 2008 8:40 AM by bibou

    error in creating a dynamic menu with richfaces

    bibou

      hi
      i am trying to create a dynamic menu with jsf and richfaces, unfortunately I have an error.
      what i woulfd like to do is to display the <rich:panelMenuItem> as a customers' products. So I have done a methode @ Factory("userProducts") in my actionBean object wo affects to [I]List userProducts[/I] attributs a list of the clients products.


      My menu int he file customer.xhtml is as folloaw:

      [CODE] <h:form id="customerForm">
      <h:panelGrid columns="2" columnClasses="cols" width="100%">
      <rich:panelMenu style="width:200px" mode="ajax"
      iconExpandedGroup="disc" iconCollapsedGroup="disc"
      iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"
      iconCollapsedTopGroup="chevronDown" iconCollapsedTopPosition="right" >
      <rich:panelMenuGroup label="Products">
      <!--the repeat tag calls the actionBeanUserProduct, and thevariable "prod" is the Liste that contanis the clients' product-->
      <a4j:repeat value="#{userProducts}" var="prod">
      <rich:panelMenuItem label="#{prod.name}" >
      <f:param name="current" value="#{prod.name}"/>
      </rich:panelMenuItem>
      </a4j:repeat>
      </rich:panelMenuGroup>


      </rich:panelMenu>

      </h:panelGrid>

      </h:form>

      With that code i would like to create PanelMenuItem having the name of product.

      the error is as follow:

      org.ajax4jsf.component.html.HtmlAjaxRepeat cannot be cast to org.richfaces.component.UIPanelMenuItem


        • 1. Re: error in creating a dynamic menu with richfaces
          bibou

          update:
          hi
          i am trying to create a dynamic menu with jsf and richfaces, unfortunately I have an error.
          what i would like to do is to display the <rich:panelMenuItem> as a customers' products. So I have done a methode @ Factory("userProducts") in my actionBean object that affects to List userProducts] attributs a list of the clients products.

          My menu in the file customer.xhtml is as folloaw:

          <h:form id="customerForm">
          
          <h:panelGrid columns="2" columnClasses="cols" width="100%">
          
          <rich:panelMenu style="width:200px" mode="ajax"
          iconExpandedGroup="disc" iconCollapsedGroup="disc"
          iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"
          iconCollapsedTopGroup="chevronDown" iconCollapsedTopPosition="right" >
          
          <rich:panelMenuGroup label="Products">
          <!--the repeat tag calls the actionBeanUserProduct, and thevariable "prod" is the Liste that contanis the clients' product-->
          
          <a4j:repeat value="#{userProducts}" var="prod">
          <rich:panelMenuItem label="#{prod.name}" >
          <f:param name="current" value="#{prod.name}"/>
          </rich:panelMenuItem>
          
          </a4j:repeat>
          </rich:panelMenuGroup>
          
          </rich:panelMenu>
          
          </h:panelGrid>
          
          </h:form>


          With that code i would like to create PanelMenuItem having the name of product.

          the error is as follow:

          org.ajax4jsf.component.html.HtmlAjaxRepeat cannot be cast to org.richfaces.component.UIPanelMenuItem


          cheers