0

使用 Tomcat 7.0.34、Primefaces 3.5 和 mojarra 2.1.25 我有以下文件“client.xhtml”:

  <ui:composition template="/templates/Template.xhtml"
  xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"
  xmlns:ui="http://java.sun.com/jsf/facelets">
  <ui:define name="template_conteudo">
  <h:form id="formDadosCliente">
  <ui:include src="/client.inc"/>
  </h:form>
  </ui:define>
  </ui:composition>

文件 client.inc(它是一个普通的 xhtml,在几个 xhtml 文件中使用)如下:(简化)

<ui:fragment xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"
             xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets"
             xmlns:p="http://primefaces.org/ui">    
    <p:tabView>
        <p:tab title="Client Info">
            // Client info stuff
        </p:tab>

        <ui:include src="clientBilling.inc"/>
    </p:tabView>
</ui:fragment>

和“clientBilling.inc”:(我在其他几个 xhtml 文件中使用)

<p:tab title="other tab">
</p:tab>

<p:tab title="another tab">
</p:tab>

“clientBilling.inc”中的选项卡未显示,但如果我将其从 p:tabView 中取出,则会显示内容。

4

1 回答 1

2

只是偶然发现这个没有答案的老问题,我喜欢尝试......

在 clientBilling.inc 中添加几行时,我得到了这个工作:

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
                xmlns:p="http://primefaces.org/ui">

  <p:tab title="other tab">
  </p:tab>

  <p:tab title="another tab">
  </p:tab>

</ui:composition>
于 2014-07-18T06:13:31.847 回答