使用Richfaces 4.0 / JSF 2.0 / Tomcat。我创建了一个页面来渲染panelMenu和dropDownMenu。但是,panelMenu只是呈现为纯文本而dropDownMenu完全不呈现。看屏幕图片:
当我尝试使用RichFaces 3.3.3时,它们会正确呈现。但是,我开始收到一个错误,标签h:header在我的其他页面中无法识别。我添加了以下文件: -
我的代码:
<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>
我的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>
答案 0 :(得分:0)
我终于从here得到了答案。有很多问题: -
相当混乱......