4 Replies Latest reply on Jan 9, 2008 5:38 AM by Ilya Shaikovsky

    Dynamic rich:dropDownMenu

    Ali Reza Mohseni Newbie

      hi

      i want make menu from database .
      i have 1 table like below :

      id ---- rootid----text
      -----------------------
      1 0 File
      2 0 Edit
      3 1 Save
      4 2 Copy
      5 2 Paste
      ------------------------

      if root id ==0 must be show in dropDownMenu (Root Menu)
      else must be show in menuItem where rootid=id

      i used seam and i can get all data from table but i can not itrate in menuitem (sub menu not show).

      my code :

      <ui:repeat value="#{menuList.resultList}" var="root">
      <rich:dropDownMenu value="#{root.text}" rendered="#{root.id eq 0}">

      <ui:repeat value="${menuList.resultList}" var="sub" >
      <rich:menuItem value="#{sub.text}" rendered="#{sub.rootid eq root.id}"/>
      </ui:repeat>

      </rich:dropDownMenu>
      </ui:repeat>

      this code just show File and Edit and sub menus are empty.

      why? and what i must to do?