2016-12-07 43 views
0

我想在兩個單獨的tabs.I設計日曆我無法導航到不同的標籤 Main.xhtml(當標籤被設計)Primefaces日曆在不同的標籤不工作時動態設置爲true

後打開彈出日曆
<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>  

請注意,當Main.xhtml中的dynamic =「true」被刪除時,它工作正常

回答

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> 
+0

由於它的工作,但現在我的關心,當我使用HTML標籤,而不是爲爲什麼一切工作都很完美,但日曆。 –

+0

瀏覽器和HTML都非常寬容;) – jklee