1 Reply Latest reply on Jan 7, 2008 8:40 PM by sergeysmirnov

    RichFaces + Seam + Manually creating components (java code)

    utiba_davidr

      Hey,

      I am hoping someone here can help me work out how to dynamically build a PanelMenu. I have implemented the code (in a way I think is meant to work):

      DynamicMenu class:

      @Name("dmenu")
      @AutoCreate
      public class DynamicMenu {
      
       private List menuItems;
      
       public List getMenuItems() {
       if (menuItems == null) {
       System.out.println("Pimping out the menu ...");
      
       HtmlPanelMenuGroup myPanelMenuGroup = new HtmlPanelMenuGroup();
       myPanelMenuGroup.setLabel("My Group");
      
       HtmlPanelMenuItem myPanelMenuItem = new HtmlPanelMenuItem();
       myPanelMenuItem.setLabel("My Item");
      
       myPanelMenuGroup.setValue(new Object[]{myPanelMenuItem});
      
       menuItems.add(myPanelMenuGroup);
       }
      
       return menuItems;
       }
      
       public void setMenuItems(List menuItems) {
       this.menuItems = menuItems;
       }
      
      }



      XHTML code:

       <rich:panelMenu style="width:200px"
       iconExpandedGroup="disc" iconCollapsedGroup="disc"
       iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"
       iconCollapsedTopGroup="chevronDown" iconCollapsedTopPosition="right"
       rendered="#{identity.loggedIn}"
       binding="#{dmenu.menuItems}"/>
      



      The issue so far in trying to get this example to work is that i am not sure where to put the rich faces JARS so that my EJB code can find them as well. Currently I have the richfaces-api inside the ear and richfaces-ui and richfaces-impl inside WEB-INF/lib inside the war file.

      I am running version 3.1.2.GA of richfaces and 2.0.GA for Seam.

      Thanks in advance,

      David