JSF primefaces不适用于ui:composition

时间:2015-10-06 15:26:58

标签: templates primefaces

在使用PrimeFaces和模板的JSF中。当我放入代码时,我的PrimeFaces效果都没有起作用。

尝试了不同的主要组成部分 - > Dialog,OverlayPanel,Expansion .....

当我在没有模板的情况下编写相同的代码(所有内容都在一个XHTML中)时,它可以正常工作。

请帮助我摆脱这种情况。

这是我的template.xhtml

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
`"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">`
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://java.sun.com/jsf/core">

<h:head>

    <h:outputStylesheet library="css" name="table-style.css" />
<p:ajaxStatus onstart="statusDialog.show();"
    onsuccess="statusDialog.hide();" />
</h:head>

<h:body onload="statusDialog.hide();">
<div id="page">


    <p:layout fullPage="true" resizeTitle="resize"
        style="background-color:#F03D0C;">

        <div id="header">
            <p:layoutUnit position="north" size="75" id="north"
                style="background-color:#F03D0C;">
                <ui:include src="header.xhtml" />
            </p:layoutUnit>

        </div>

        <div id="center">
            <p:layoutUnit styleClass="layoutUnitCenter" position="center">
                <h:form id="mainForm">
                    <p:messages autoUpdate="true" id="msgs" showDetail="true"
                        showSummary="true" />
                    <ui:insert name="content" />
                    <ui:include src="menu.xhtml" />
                </h:form>
            </p:layoutUnit>
        </div>

        <div id="footer">

            <p:layoutUnit position="south" resizable="true" id="south">
                <ui:include src="footer.xhtml" />
            </p:layoutUnit>
        </div>
    </p:layout>
</div>

这是我的内容xhtml

<?xml version="1.0" encoding="UTF-8"?>
<!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:body>

    <ui:composition template="/templates/template.xhtml">

    <ui:define name="content">

        <h:form id="incidentForm">

            <p:dataTable var="incdData" value="#{incidentDashboardView.incLst}"
                styleClass="ui-datatable-data">

                <f:facet name="header">Expand rows to see detailed information</f:facet>

                <p:column style="width:16px">
                    <p:rowToggler />
                </p:column>

                <p:column headerText="Application"
                    sortBy="#{incdData.applicationName}">
                    <h:outputLink value="#{incdData.iteraUrl}">
                        <h:outputText value="#{incdData.applicationName}" />
                    </h:outputLink>
                </p:column>

                <p:column headerText="Total Ticket"
                    sortBy="#{incdData.totalTicket}">
                    <h:outputText value="#{incdData.totalTicket}" />
                </p:column>

                <p:column headerText="Assigned" sortBy="#{incdData.assignedTicket}">
                    <h:outputText value="#{incdData.assignedTicket}" />
                </p:column>

                <p:column headerText="InProgress"
                    sortBy="#{incdData.inProgressTicket}">
                    <h:outputText value="#{incdData.inProgressTicket}" />
                </p:column>

                <p:column headerText="Pending" sortBy="#{incdData.pendingTicket}">
                    <h:outputText value="#{incdData.pendingTicket}" />
                </p:column>

                <p:column headerText="Closed" sortBy="#{incdData.closedTicket}">
                    <h:outputText value="#{incdData.closedTicket}" />
                </p:column>

                <p:rowExpansion>
                    <p:panelGrid columns="2" columnClasses="label,value"
                        style="width:300px">

                        <p:dataTable var="incdAppDetailData"
                        value="#{incdData.incidentData}" styleClass="ui-datatable-data">
                        <p:columnGroup type="header">
                            <p:row>
                                <p:column headerText="Application"
                                    sortBy="#{incdAppDetailData.applicationName}" />
                                <p:column headerText="Ticket"
                                    sortBy="#{incdAppDetailData.incidentID}" />
                                <p:column headerText="Status"
                                    sortBy="#{incdAppDetailData.status}" />
                                <p:column headerText="Reported Date"
                                    sortBy="#{incdAppDetailData.reportedDate}" />
                            </p:row>
                        </p:columnGroup>

                        <p:column>
                            <h:outputText value="#{incdAppDetailData.applicationName}" />
                        </p:column>

                        <p:column>
                            <h:outputText value="#{incdAppDetailData.incidentID}" />
                        </p:column>

                        <p:column>
                            <h:outputText value="#{incdAppDetailData.status}" />
                        </p:column>

                        <p:column>
                            <h:outputText value="#{incdAppDetailData.reportedDate}" />
                        </p:column>

                    </p:dataTable> 


                    </p:panelGrid>
                </p:rowExpansion>
            </p:dataTable>
        </h:form>
    </ui:define>
</ui:composition>

0 个答案:

没有答案