2 Replies Latest reply on Sep 4, 2009 12:10 PM by Juergen Hartler

    Dynamic Dropdown menu

    Palani swamy Newbie
      Hi

      Everyone, I new in richfaces,

      This is my code,

      <rich:dropDownMenu submitMode="none" value="Collateral Catalog">
        <ui:repeat value="#{productCategoryList.GetProductName()}"
           var="newsItem">
           <rich:menuItem >
              <h:outputText  value="#{newsItem.productCategoryName}"/>
           </rich:menuItem>
         </ui:repeat>
      </rich:dropDownMenu>

      This code is not working,Any body give me example code,

      regards
      jack

        • 1. Re: Dynamic Dropdown menu
          Leo van den berg Master

          Jack,


          A simple example of a selectOneMenu with a list of values. It uses a query for the attributes
          and convertEntity to be able to use direct entities in the reply.


          <h:selectOneMenu value="#{someBean.someAttrribute}">
           <s:selectItems value="#{attributesQuery.resultList}" var="t" label="#{t.label}" />
           <s:convertEntity />
          </h:selectOneMenu>



          This examples can be found in the examples of the Seam-distribution, the documantation, Seam-gen makes them for you etc.


          • 2. Re: Dynamic Dropdown menu
            Juergen Hartler Newbie
            Hi!

            In order to create the Dropdown menu dynamically you must use a binding. This issue has already been discussed at:

            http://www.jboss.org/index.html?module=bb&op=viewtopic&t=110983

            The solution you will find at the bottom of the page!

            Regards,
            Juergen