1 Reply Latest reply on Nov 12, 2012 7:33 PM by gebuh

    Richfaces 4 dynamically created rich components display as text instead of menus/links

    gebuh Newbie

      I posted this over in Stack overflow, but I'm not getting much traction:

      http://stackoverflow.com/questions/13259907/richfaces-4-dynamically-created-rich-components-display-as-text-instead-of-menus

       

      I'm migrating from RF3.3.3, JSF1.2 and jboss 5 to JSF2/ RF4/jboss7.  We have a rich toolbar group with dropdown menus that is generated from a database table.  I made the changes to web.xml, renamed the applicable components in the backing bean, but the toolbar will only show as text instead of dropdown menus and links.

       

      I see that other people had the same problem but none of the suggested solutions is working for me.  Anybody got any ideas?

      web.xml:

      <?xml version="1.0"?> <web-app version="3.0" 
      xmlns="http://java.sun.com/xml/ns/javaee" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
      http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> 
      <context-param> <param-name>org.richfaces.enableControlSkinning</param-name> 
      <param-value>true</param-value> </context-param> <context-param> 
      <param-name>org.richfaces.enableControlSkinningClasses</param-name> 
      <param-value>false</param-value> </context-param>  
      <context-param> <param-name>org.richfaces.resourceOptimization.enabled</param-name> 
      <param-value>true</param-value> </context-param>  
      <context-param> <param-name>org.richfaces.skin</param-name> 
      <param-value>blueSky</param-value> </context-param>

       

      menu.xhtml - included in a template.xhtml with h:head and h:body tags:

       

      <h:form id="mnMenu">
      <rich:toolbar id="tb" >
          <rich:toolbarGroup>
          <s:link id="menuHomeId" view="/home.xhtml" value="Home" propagation="none"/>
          </rich:toolbarGroup>
      
          <rich:toolbarGroup binding="#{menuQueries.myBarGrp}" />
      
      </rich:toolbar>
      <!-- account for jsf bug? bug DOESN'T WORK -->
          <rich:toolbar rendered="false"/>
          <rich:toolbarGroup rendered="false"/>
          <rich:dropDownMenu rendered="false"/>
          <rich:menuGroup rendered="false"/>
          <rich:menuItem rendered="false"/>
      </h:form>

       

       

       

      from backing bean - this method creates the toolbar group, it originally looked like this (worked in 2.2):

       

      public HtmlToolBarGroup getMyBarGrp()
      {
           this.myBarGrp = new org.richfaces.component.html.HtmlToolBarGroup();
           for (CtsPermissionHierarchyAltV each : this.getMainMenuList()) {
                this.myBarGrp.getChildren().add(getDropDownMenu(each));
           }
      return this.myBarGrp;
      }

       

       

      I changed it to this, doesn't make a difference:

       

      public UIToolbarGroup getMyBarGrp()
      {
           FacesContext ctx = FacesContext.getCurrentInstance();
           this.myBarGrp = (UIToolbarGroup) ctx.getApplication().createComponent(ctx,     
            UIToolbarGroup.COMPONENT_TYPE, "org.richfaces.ToolbarGroupRenderer");
           this.myBarGrp.setId("dynMenuGrp");
           for (CtsPermissionHierarchyAltV each : this.getMainMenuList()) 
           {    
                this.myBarGrp.getChildren().add(getDropDownMenu(each));
           }
      }

       

       


      the getDropDownMenu and submenu methods are coded similarly. I'm not getting any errors.

      FF firebug output for text that should be a dropdown menu looks like this:

      <div id="mnMenu:Communications" class="rf-ddm-lbl rf-ddm-unsel ">
      ... more stuff

       


      Pre-migration it looked like this:

      <div id="mnMenu:Communications" class="rich-ddmenu-label rich-ddmenu-label-unselect">
      ... more stuff

       

       

      Navigating through the firebug output I can see all the submenus - but they're all text references.

      I see all my css files - they're showing up in body instead of head, but they're all there. Did I miss something?  What else can I check?

       

      jboss 7.1.1 Seam 2.3.0 JSF2.1 RichFaces 4.2.2