rich:tabPanel 未呈现
rich:tabPanel is not rendering
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:jsf="http://xmlns.jcp.org/jsf"
xmlns:c="http://xmlns.jcp.org/jsf/core"
xmlns:f="http://java.sun.com/jsp/jstl/core"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:pe="http://primefaces.org/ui/extensions"
xmlns:gestenis="http://gestenis.com/jsf/facelets">
<c:view>
<body jsf:id="staffBody">
<a4j:form id="pfform" >
<h:panelGrid>
<rich:tabPanel switchType="ajax">
<rich:tab label="First">
Here is tab #1
</rich:tab>
<rich:tab label="Second">
Here is tab #2
</rich:tab>
<rich:tab label="Third">
Here is tab #3
</rich:tab>
</rich:tabPanel>
....
结果是:
这是选项卡 #1 这是选项卡 #2 这是选项卡 #3
全部在一行中,因此无法正确呈现
有什么想法吗?
谢谢
可能 xml 命名空间混乱。以下应该有效(RichFaces 4.5.x):
<!DOCTYPE html>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:body id="staffBody">
<h:form id="pfform" >
<h:panelGrid>
<rich:tabPanel switchType="ajax">
<rich:tab name="First">
Here is tab #1
</rich:tab>
<rich:tab name="Second">
Here is tab #2
</rich:tab>
<rich:tab name="Third">
Here is tab #3
</rich:tab>
</rich:tabPanel>
</h:panelGrid>
</h:form>
</h:body>
</ui:composition>
解决方案是:
在类路径中添加 jar 依赖项 (webapps/lib) 如果没有它丰富的组件不会转换为 html.
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:jsf="http://xmlns.jcp.org/jsf"
xmlns:c="http://xmlns.jcp.org/jsf/core"
xmlns:f="http://java.sun.com/jsp/jstl/core"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:pe="http://primefaces.org/ui/extensions"
xmlns:gestenis="http://gestenis.com/jsf/facelets">
<c:view>
<body jsf:id="staffBody">
<a4j:form id="pfform" >
<h:panelGrid>
<rich:tabPanel switchType="ajax">
<rich:tab label="First">
Here is tab #1
</rich:tab>
<rich:tab label="Second">
Here is tab #2
</rich:tab>
<rich:tab label="Third">
Here is tab #3
</rich:tab>
</rich:tabPanel>
....
结果是:
这是选项卡 #1 这是选项卡 #2 这是选项卡 #3
全部在一行中,因此无法正确呈现
有什么想法吗?
谢谢
可能 xml 命名空间混乱。以下应该有效(RichFaces 4.5.x):
<!DOCTYPE html>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:body id="staffBody">
<h:form id="pfform" >
<h:panelGrid>
<rich:tabPanel switchType="ajax">
<rich:tab name="First">
Here is tab #1
</rich:tab>
<rich:tab name="Second">
Here is tab #2
</rich:tab>
<rich:tab name="Third">
Here is tab #3
</rich:tab>
</rich:tabPanel>
</h:panelGrid>
</h:form>
</h:body>
</ui:composition>
解决方案是:
在类路径中添加 jar 依赖项 (webapps/lib) 如果没有它丰富的组件不会转换为 html.