gkinu
gkinu

Reputation: 81

Richfaces 4.0/JSF 2.0: Why are panelMenu and dropDownMenu not rendered?

Am using Richfaces 4.0/JSF 2.0/Tomcat. I have created the a page to render a panelMenu and dropDownMenu. However, panelMenu is just rendered as plain text while dropDownMenu is completely not rendered. See screen image: Screen capture

When i try same with RichFaces 3.3.3, they are rendered correctly. However, i start getting an error that tag h:header is not recognized in my other pages. I have added the following files:-

  1. richfaces-components-api-4.1.0.Final.jar
  2. richfaces-components-ui-4.1.0.Final.jar
  3. richfaces-core-api-4.1.0.Final.jar
  4. richfaces-core-impl-4.1.0.Final.jar
  5. sac-1.3.jar
  6. guava-r09.jar
  7. cssparser-0.9.5.jar
  8. jsf-api.jar and jsf-impl.jar (2.0)

My code:

    <h:body>

    <h:form id="form2">
        <rich:dropDownMenu value="MENU">
            <rich:menuItem value="ITEM1"></rich:menuItem>
            <rich:menuItem value="ITEM2"></rich:menuItem>
        </rich:dropDownMenu>
    </h:form>
    <h:form id="form">
        <h:panelGrid columns="2" columnClasses="cols,cols" width="400">
            <rich:panelMenu style="width:200px" mode="ajax"
                iconExpandedGroup="disc" iconCollapsedGroup="disc"
                iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"
                iconCollapsedTopGroup="chevronDown">
                <rich:panelMenuGroup label="Group 1">
                    <rich:panelMenuItem label="Item 1.1"
                        action="#{panelMenu.updateCurrent}">
                        <f:param name="current" value="Item 1.1" />
                    </rich:panelMenuItem>
                    <rich:panelMenuItem label="Item 1.2"
                        action="#{panelMenu.updateCurrent}">
                        <f:param name="current" value="Item 1.2" />
                    </rich:panelMenuItem>
                    <rich:panelMenuItem label="Item 1.3"
                        action="#{panelMenu.updateCurrent}">
                        <f:param name="current" value="Item 1.3" />
                    </rich:panelMenuItem>
                </rich:panelMenuGroup>
            </rich:panelMenu>
            <rich:panel bodyClass="rich-laguna-panel-no-header">
                <a4j:outputPanel ajaxRendered="true">
                    <h:outputText value="#{panelMenu.current} selected" id="current" />
                </a4j:outputPanel>
            </rich:panel>
        </h:panelGrid>
    </h:form>
</h:body>

My web.xml:

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.0"
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.SKIN</param-name>
    <param-value>blueSky</param-value>
</context-param>

<context-param>
    <param-name>org.richfaces.CONTROL_SKINNING</param-name>
    <param-value>enable</param-value>
</context-param>
<context-param>
    <param-name>org.richfaces.LoadScriptStrategy</param-name>
    <param-value>ALL</param-value>
</context-param>

<context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>
<context-param>
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    <param-value>.xhtml</param-value>
</context-param>

<context-param>
    <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
    <param-value>com.sun.facelets.FaceletViewHandler</param-value>
</context-param>

<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>*.faces</url-pattern>
</servlet-mapping>

Upvotes: 0

Views: 3895

Answers (1)

gkinu
gkinu

Reputation: 81

I finally got my answers from here. There were a number of issues:-

  1. Turns out that RichFaces 4.0 renamed a number of parameters specified in web.xml e.g. org.richfaces.SKIN (now org.richfaces.skin), org.richfaces.CONTROL_SKINNING (now org.richfaces.enableControlSkinning) etc
  2. Looks like skinning will not work without h:head tag.

Pretty confusing ....

Upvotes: 0

Related Questions