Prime表格当动态设置为true时,日历在不同的选项卡中不起作用

时间:2016-12-07 09:26:38

标签: jsf primefaces jsf-2

我正在尝试在两个单独的标签中设计日历。导航到不同的标签后,我无法打开日历弹出窗口 Main.xhtml(选项卡的设计)

    <p:tabView id="CRE_CI" widgetVar="TabV" prependId="false" cache="false" dynamic="true">
    <p:tab title="CRE Residential Input" style="outline: 0;">
    <ui:include src="CRE//abc.xhtml" />
    </p:tab>
    <p:tab title="CRE Commercial Analysis" style="outline: 0;">
    <ui:include src="CRE//xyz.xhtml" />
    </p:tab>
    </p:tabView>

abc.xhtml

   <html 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">
   <h:head>
   <title>Commercial Analysis</title>
    </h:head>
    <div id="CRECommAnalysis">
    <h:body>
    <h:form id="crecommform">
    <p:calendar id="commcal1" navigator="true" pattern="MM/dd/yy"style="width:100%" >
                    </p:calendar>
            </h:form>
        </h:body>
    </div>
    </html>     

xyz.xhtml

    <html 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">
    <h:head>
    <title>Commercial Analysis</title>
    </h:head>
    <div id="CRECommA">
    <h:body>
    <h:form id="crecomm">
    <p:calendar id="commcal2"/>
    </h:form>
    </h:body>
    </div>
    </html>     

请注意,当动态=&#34; true&#34;它正常工作从Main.xhtml删除

1 个答案:

答案 0 :(得分:0)

您构建包含错误的网页。这对我有用。

的index.xhtml

<!DOCTYPE html>
<html 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">
<h:head>
    <title>Commercial Analysis</title>
</h:head>
<h:body>
        <p:tabView id="CRE_CI" widgetVar="TabV" prependId="false"
            cache="false" dynamic="true">
            <p:tab title="CRE Residential Input" style="outline: 0;">
                <ui:include src="abc.xhtml" />
            </p:tab>
            <p:tab title="CRE Commercial Analysis" style="outline: 0;">
                <ui:include src="xyz.xhtml" />
            </p:tab>
        </p:tabView>
</h:body>
</html>

abc.xhtml

<ui:composition 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">
    <div id="CRECommAnalysis">
        <h:form id="crecommform">
            <p:calendar id="commcal1" navigator="true" pattern="MM/dd/yy"
                style="width:100%">
            </p:calendar>
        </h:form>
    </div>
</ui:composition>

xyz.xhtml

<ui:composition 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">
    <div id="CRECommA">
        <h:form id="crecomm">
            <p:calendar id="commcal2" />
        </h:form>
    </div>
</ui:composition>