Unable to Expand rich:panelMenu
sushil003 Apr 3, 2015 4:02 PMHi All,
I am trying to replicate the example mentioned on richfaces show case site for rich panel menu RichFaces Showcase.
I am able to see rich panel menu rendered in browser screen however when I click on any groups its not at all expanding as a result I cannot see the menu item.
Here are the details:
I am using richfaces 4.5.3, myfaces 2.2 ,tomcat 7. added all richfaces mandatory and third party mendatory jars for this version of richfaces.
files details are as follows:
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>TestRichfacesMenuBar1</display-name>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<!-- Plugging the "Blue Sky" skin into the project -->
<context-param>
<param-name>org.richfaces.skin</param-name>
<param-value>blueSky</param-value>
</context-param>
<!-- Making the RichFaces skin spread to standard HTML controls -->
<context-param>
<param-name>org.richfaces.CONTROL_SKINNING</param-name>
<param-value>enable</param-value>
</context-param>
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>resources.application</param-value>
</context-param>
<context-param>
<description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<description>Default is 'true'</description>
<param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<description>
Default is 'true'</description>
<param-name>org.apache.myfaces.PRETTY_HTML</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<description>
</description>
<param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
<param-value>true</param-value>
</context-param>
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>
</web-app>
NewFile.Xhtml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=http://www.w3.org/1999/xhtml
xmlns:h=http://java.sun.com/jsf/html
xmlns:a4j=http://richfaces.org/a4j
xmlns:rich=http://richfaces.org/rich
xmlns:f=http://java.sun.com/jsf/core
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head></h:head>
<body>
<h:form id="form">
<h:panelGrid columns="2" style="width:450px">
<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>
<a4j:outputPanel ajaxRendered="true">
<rich:panel rendered="#{not empty panelMenuBean.current}">
<h:outputText value="#{panelMenuBean.current} selected" id="current" />
</rich:panel>
</a4j:outputPanel>
</h:panelGrid>
</h:form>
</body>
</html>
PanelMenuBean Managed bean:
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import org.richfaces.event.ItemChangeEvent
@ManagedBean(name = "panelMenuBean")
public class PanelMenuBean {
private String current;
public void updateCurrent(ItemChangeEvent evt) {
current = evt.getNewItemName();
public String getCurrent() {
return current;
public void setCurrent(String current) {
this.current = current;
}}
Please Help me to figure out what is the problem. Thank you in advance !
Regards,
Sushil