1 Reply Latest reply on Aug 26, 2011 12:53 PM by wilariz

    RichFaces is not defined

    wilariz

      Hi, I'm trying implementing a dynamic menu with PanelMenu, I'm using richfaces 4 / jsf 2 /facelets 1.1.14. but i have this error in firebug/mozilla :

      RichFaces is not defined.

      here my menu.xhtml :

       

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

      <ui:composition xmlns:h="http://java.sun.com/jsf/html"

          xmlns:f="http://java.sun.com/jsf/core"

          xmlns:ui="http://java.sun.com/jsf/facelets"

          xmlns:a4j="http://richfaces.org/a4j"

          xmlns:rich="http://richfaces.org/rich">

          <f:view>

              <h:head />

              <h:body>

                  <rich:panelMenu mode="ajax" id="menu2"

                      binding="#{MenuController.panelMenu}">

                  </rich:panelMenu>

              </h:body>

          </f:view>

      </ui:composition>

       

      my test bean:

       

      package com.lumbreras.web;

       

      import java.util.ArrayList;

      import java.util.List;

       

      import javax.faces.application.Application;

      import javax.faces.bean.ManagedBean;

      import javax.faces.bean.SessionScoped;

      import javax.faces.context.FacesContext;

       

      import org.richfaces.component.UIMenuItem;

      import org.richfaces.component.UIPanelMenu;

      import org.richfaces.component.UIPanelMenuGroup;

      import org.springframework.context.annotation.Scope;

      import org.springframework.stereotype.Controller;

       

      import com.lumbreras.domain.Modulo;

       

      @ManagedBean(name = "MenuController")

      @SessionScoped

      public class MenuController {

          private UIPanelMenu panelMenu;

       

          public MenuController() {

       

          }

       

          public UIPanelMenu getPanelMenu() {

              List<Modulo> aListN1 = new ArrayList<Modulo>();

              panelMenu = new  UIPanelMenu();

       

              panelMenu.setTopGroupExpandedRightIcon("chevronUp");

              panelMenu.setTopGroupCollapsedRightIcon("chevronDown");

              panelMenu.setGroupExpandedLeftIcon("disc");

              panelMenu.setGroupCollapsedLeftIcon("disc");

       

      /* here : more source lines adding menugroups an menuitems  but test  I only return panelMenu */

        

       

                 return panelMenu;

          }

       

          public void setPanelMenu(UIPanelMenu panelMenu) {

              this.panelMenu = panelMenu;

          }

      }

       

      my method getPanelMenu is simple, so it should show but I got the error above.

      anyone can help me plss?

        • 1. Re: RichFaces is not defined
          wilariz

          Hi.

          I found this solution:

          http://community.jboss.org/message/601807#601807

          but when I'm doing this change :

           

          FacesContext fc = FacesContext.getCurrentInstance();

                              Application application = FacesContext.getCurrentInstance()

                                                  .getApplication();

           

          panelMenu = (UIPanelMenu) application

                                                  .createComponent(fc, UIPanelMenu.COMPONENT_TYPE, "org.richfaces.PanelMenuRenderer");

           

          I've got this error of eclipse:

          The type javax.el.ValueExpression cannot be resolved. It is indirectly referenced from required .class files.

           

          Regards.!