我对主要人物很新。我试图在对话框中实现primefaces选项卡视图。但它只呈现第一个选项卡,并且不显示任何其他选项卡。当我检查元素时,我看到那里的所有其他标签代码,但它们都是灰色的。
的index.xhtml
<ui:composition template="/WEB-INF/templates/main.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<h:form id="addressForm">
<div align="center">
<p:commandButton value="Edit" id="editInfo" onclick="PF('dlg').show();"
icon="ui-icon-pencil" />
<p:dialog widgetVar="dlg" width="860" height="540" header="Information" maximizable="true" minimizable="true" showEffect="fade">
<ui:include src="editTabView.xhtml"/>
</p:dialog>
</div>
</h:form>
</ui:composition>
editTabView.xhtml
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:b="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:ui="http://java.sun.com/jsf/facelets">
<p:tabView cache="true" id="tabView" scrollable="true">
<p:tab id="localAddressTab" title="Local Address">
<h:form id="localAddressForm">
<h1>Testing</h1>
</h:form>
</p:tab>
<p:tab id="permAddressTab" title="Permanent Address">
<h:form id="permAddressForm">
<h1>Testing</h1>
</h:form>
</p:tab>
<p:tab id="mailAddressTab" title="Mailing Address">
<h:form id="mailAddressForm">
<h1>Testing</h1>
</h:form>
</p:tab>
</p:tabview>
</ui:composition>
我不确定我错过了什么。任何人都可以帮助我。
答案 0 :(得分:0)
也许问题是你有嵌套表格;将表单删除到每个<p:tab>
中。所有数据都将由<h:form id="addressForm">