6 Replies Latest reply on Jun 25, 2012 8:48 AM by Wallace Pontes

    Richfaces 4.2.1.Final and JSF 2.0

    wael.boughzala Newbie

      I have a prblem with panelMenu:

       

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

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"

                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:form id="form">

                                    <h:panelGrid columns="2" columnClasses="cols,cols" width="400">

                                              <rich:panelMenu style="width:200px" itemMode="ajax"

                                                        groupMode="ajax" groupExpandedLeftIcon="triangleUp"

                                                        groupCollapsedLeftIcon="triangleDown"

                                                        topGroupExpandedRightIcon="chevronUp"

                                                        topGroupCollapsedRightIcon="chevronDown" itemLeftIcon="disc"

                                                        itemChangeListener="#{panelMenuBean.updateCurrent}">

                                                        <rich:panelMenuGroup label="Group 1">

                                                                  <rich:panelMenuItem label="Item 1.1" name="Item_1_1" />

                                                                  <rich:panelMenuItem label="Item 1.2" name="Item_1_2" />

                                                                  <rich:panelMenuItem label="Item 1.3" name="Item_1_3" />

                                                        </rich:panelMenuGroup>

                                                        <rich:panelMenuGroup label="Group 2">

                                                                  <rich:panelMenuItem label="Item 2.1" name="Item_2_1" />

                                                                  <rich:panelMenuItem label="Item 2.2" name="Item_2_2" />

                                                                  <rich:panelMenuItem label="Item 2.3" name="Item_2_3" />

                                                                  <rich:panelMenuGroup label="Group 2.4">

                                                                            <rich:panelMenuItem label="Item 2.4.1" name="Item_2_4_1" />

                                                                            <rich:panelMenuItem label="Item 2.4.2" name="Item_2_4_2" />

                                                                            <rich:panelMenuItem label="Item 2.4.3" name="Item_2_4_3" />

                                                                  </rich:panelMenuGroup>

                                                                  <rich:panelMenuItem label="Item 2.5" name="Item_2_5" />

                                                        </rich:panelMenuGroup>

                                                        <rich:panelMenuGroup label="Group 3">

                                                                  <rich:panelMenuItem label="Item 3.1" name="Item_3_1" />

                                                                  <rich:panelMenuItem label="Item 3.2" name="Item_3_2" />

                                                                  <rich:panelMenuItem label="Item 3.3" name="Item_3_3" />

                                                        </rich:panelMenuGroup>

                                              </rich:panelMenu>

       

       

                                    </h:panelGrid>

                          </h:form>

                </f:view>

      </ui:composition>

       

      I have this error:

       

      22 mai 2012 00:08:00 org.apache.catalina.core.StandardWrapperValve invoke

      GRAVE: "Servlet.service()" pour la servlet FacesServlet a généré une exception

      java.lang.IllegalArgumentException: Cannot convert ajax of type class java.lang.String to class org.richfaces.PanelMenuMode

      at com.sun.el.lang.ELSupport.coerceToType(ELSupport.java:329)

      at com.sun.el.ExpressionFactoryImpl.coerceToType(ExpressionFactoryImpl.java:43)

      at com.sun.faces.facelets.tag.BeanPropertyTagRule$LiteralPropertyMetadata.applyMetadata(BeanPropertyTagRule.java:88)

      at com.sun.faces.facelets.tag.MetadataImpl.applyMetadata(MetadataImpl.java:81)

      at javax.faces.view.facelets.MetaTagHandler.setAttributes(MetaTagHandler.java:129)

      at javax.faces.view.facelets.DelegatingMetaTagHandler.setAttributes(DelegatingMetaTagHandler.java:102)

      at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.setAttributes(BehaviorsAddingComponentHandlerWrapper.java:113)

      at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.doNewComponentActions(ComponentTagHandlerDelegateImpl.java:409)

      at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:159)

      at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)

      at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)

      at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53)

      at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)

      at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)

      at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)

      at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53)

      at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)

      at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)

      at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)

      at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)

      at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)

      at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)

      at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:152)

      at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:774)

      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100)

      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)

      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)

      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)

      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)

      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)

      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

      at java.lang.Thread.run(Unknown Source)