Primefaces 5.3 - TypeError:this.jq.on不是函数

时间:2016-10-03 13:00:45

标签: jquery jsf primefaces uncaught-typeerror

我对Primefaces可编辑数据表有以下问题:

MainTemplate:

       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
    <html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:c="http://java.sun.com/jsp/jstl/core"
        xmlns:fn="http://java.sun.com/jsp/jstl/functions"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:a4j="http://richfaces.org/a4j"
        xmlns:rich="http://richfaces.org/rich"
        xmlns:p="http://primefaces.org/ui">
        <f:loadBundle basename="labels" var="msgLabels"/>
        <f:loadBundle basename="messages" var="messages"/>
        <f:loadBundle basename="errors" var="msgErrors"/>
        <h:head>
            <title>Fideba v4.8.0</title>

            <meta Http-Equiv="Cache-Control" Content="no-cache" />
            <meta Http-Equiv="Pragma" Content="no-cache" />
            <meta Http-Equiv="Expires" Content="-1" /> 
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />


            <link rel="stylesheet" type="text/css" href="${staticPrefix}/css/header.css" />
            <link rel="stylesheet" type="text/css" href="${staticPrefix}/css/datatable.css" />

            <link type="text/css" rel="stylesheet" href="${staticPrefix}/css/skinning.css" />
            <link type="text/css" rel="stylesheet" href="${staticPrefix}/css/popupPanel.css" />
            <link type="text/css" rel="stylesheet" href="${staticPrefix}/css/tabPanel.css" />
            <link type="text/css" rel="stylesheet" href="${staticPrefix}/css/panel.css" />
            <link type="text/css" rel="stylesheet" href="${staticPrefix}/css/datatable.css" />
            <link type="text/css" rel="stylesheet" href="${staticPrefix}/css/collapsible-subtable.css" />
            <link type="text/css" rel="stylesheet" href="${staticPrefix}/css/datascroller.css" />
            <link type="text/css" rel="stylesheet" href="${staticPrefix}/css/calendar.css" />
            <link type="text/css" rel="stylesheet" href="${staticPrefix}/css/msg.css" />
            <link type="text/css" rel="stylesheet" href="${staticPrefix}/css/icons.css" />
            <link type="text/css" rel="stylesheet" href="${staticPrefix}/css/collapsiblePanel.css" />
            <link type="text/css" rel="stylesheet" href="${staticPrefix}/css/tooltip.css" />
            <link type="text/css" rel="stylesheet" href="${staticPrefix}/css/reportDenaro.css" />

            <script type="text/javascript" src="${staticPrefix}/js/jquery.mofri.js"></script>
            <script type="text/javascript" src="${staticPrefix}/js/jquery.js"></script>  





            <!-- Script Rich -->
            <script type="text/javascript" src="../javax.faces.resource/richfaces.js.jsf"></script>
            <script type="text/javascript" src="../javax.faces.resource/richfaces-base-component.js.jsf"></script>
            <script type="text/javascript" src="../javax.faces.resource/popupPanel.js.jsf?ln=org.richfaces"></script>
            <script type="text/javascript" src="../javax.faces.resource/popupPanelBorders.js.jsf?ln=org.richfaces"></script>
            <script type="text/javascript" src="../javax.faces.resource/popupPanelSizer.js.jsf?ln=org.richfaces"></script>
            <script type="text/javascript" src="../javax.faces.resource/richfaces-event.js.jsf"></script>
            <script type="text/javascript" src="../javax.faces.resource/jsf.js.jsf?ln=javax.faces"></script>
            <script type="text/javascript" src="../javax.faces.resource/richfaces-queue.js.jsf"></script>
            <script type="text/javascript" src="../javax.faces.resource/togglePanel.js.jsf?ln=org.richfaces"></script>
            <script type="text/javascript" src="../javax.faces.resource/tabPanel.js.jsf?ln=org.richfaces"></script>
            <script type="text/javascript" src="../javax.faces.resource/togglePanelItem.js.jsf?ln=org.richfaces"></script>
            <script type="text/javascript" src="../javax.faces.resource/tab.js.jsf?ln=org.richfaces"></script>
            <script type="text/javascript" src="../javax.faces.resource/status.js.jsf?ln=org.richfaces"></script>
            <script type="text/javascript" src="../javax.faces.resource/component-control.js.jsf?ln=org.richfaces"></script>
            <script type="text/javascript" src="../javax.faces.resource/datatable.js.jsf?ln=org.richfaces"></script>
            <script type="text/javascript" src="../javax.faces.resource/collapsible-subtable-toggler.js.jsf?ln=org.richfaces"></script>
            <script type="text/javascript" src="../javax.faces.resource/collapsible-subtable.js.jsf?ln=org.richfaces"></script>
            <script type="text/javascript" src="../javax.faces.resource/datascroller.js.jsf?ln=org.richfaces"></script>
            <script type="text/javascript" src="../javax.faces.resource/collapsiblePanel.js.jsf?ln=org.richfaces"></script>
            <script type="text/javascript" src="../javax.faces.resource/collapsiblePanelItem.js.jsf?ln=org.richfaces"></script>
            <script type="text/javascript" src="../javax.faces.resource/jquery.position.js.jsf"></script>
            <script type="text/javascript" src="../javax.faces.resource/popup.js.jsf?ln=org.richfaces"></script>
            <script type="text/javascript" src="../javax.faces.resource/tooltip.js.jsf?ln=org.richfaces"></script>
            <script type="text/javascript" src="../javax.faces.resource/json-dom.js.jsf?ln=org.richfaces"></script>
            <script type="text/javascript" src="../javax.faces.resource/jquery.effects.core.js.jsf?ln=org.richfaces"></script>
            <script type="text/javascript" src="../javax.faces.resource/jquery.effects.highlight.js.jsf?ln=org.richfaces"></script>
            <script type="text/javascript" src="../javax.faces.resource/JQuerySpinBtn.js.jsf?ln=org.richfaces"></script>
            <script type="text/javascript" src="../javax.faces.resource/calendar-utils.js.jsf?ln=org.richfaces"></script>
            <script type="text/javascript" src="../javax.faces.resource/calendar.js.jsf?ln=org.richfaces"></script>
            <script type="text/javascript" src="../javax.faces.resource/message.js.jsf?ln=org.richfaces"></script>


            <!-- Fine Script Rich
            <h:outputScript name="jquery.js" target="head"/>
            <h:outputScript name="jquery.mofri.js" target="head"/>
             -->
        </h:head>
        <h:body  onunload="closeSession();">    
        <!--<ui:debug hotkey="x" rendered="#{initParam['javax.faces.FACELETS_DEVELOPMENT']}" />-->

        <ui:include src="../pages/common/popupError.jspx"/>
        <h:panelGrid id="pageTemplate" border="0" cellpadding="0"
             cellspacing="0" width="100%" columns="1">
                    <f:subview id="header">
                        <ui:include src="./header.jspx">
                            <ui:param name="visible" value="false"></ui:param>
                        </ui:include>
                    </f:subview>
                    <f:subview id="contentMain">
                        <ui:insert name="contentMain" />
                    </f:subview>
                    <f:subview id="footer" rendered="false">
                            <ui:include src="./footer.jspx" />
                    </f:subview>    
            </h:panelGrid>  
            <a4j:jsFunction name="closeSession" 
            execute="@this" actionListener="#{navigationManager.closeSession}" />
        </h:body>
    </html>

两页:

       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <ui:composition xmlns="http://www.w3.org/1999/xhtml"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:c="http://java.sun.com/jsp/jstl/core"
        xmlns:fn="http://java.sun.com/jsp/jstl/functions"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:a4j="http://richfaces.org/a4j"
        xmlns:rich="http://richfaces.org/rich"
        xmlns:mofri="http://java.sun.com/jsf/composite/mofri"
        xmlns:p="http://primefaces.org/ui">

        <h:head>

            <f:subview id="matriceView">
                <ui:include src="#{matriceBean.getPageUrl()}" />
            </f:subview>
        </h:head>
    </ui:composition>

另一个包含在上一个:

        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <ui:composition xmlns="http://www.w3.org/1999/xhtml"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:c="http://java.sun.com/jsp/jstl/core"
        xmlns:fn="http://java.sun.com/jsp/jstl/functions"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:a4j="http://richfaces.org/a4j"
        xmlns:rich="http://richfaces.org/rich"
        xmlns:mofri="http://java.sun.com/jsf/composite/mofri"
        xmlns:p="http://primefaces.org/ui">


        <a4j:region>
            <mofri:panel
                headerText="#{msgLabels['fide.matrice.SegnalazioneT.lista']}"
                image="/images/Icona_clienti_trasp.gif" width="100%" style="green"
                facetAlign="img_title_top" id="panelSegnalazioniU">
                <a4j:status name="segnalazioniUStatus">
                    <f:facet name="start">
                        <h:graphicImage value="#{staticPrefix}/images/ajax-loader.gif" />
                    </f:facet>
                </a4j:status>

                <f:facet name="exportButtons">
                    <h:panelGrid columns="2"
                        rendered="#{not empty matriceBean.listSegnalazioniUTitoli}">
                        <h:commandButton value="getTracciatoButton"
                            action="#{matriceBean.getTracciato}"
                            image="#{staticPrefix}/images/page_go.png" />
                        <mofri:reportToolbar
                            actionMethodReportExcel="#{matriceBean.exportExcelSegnalazioniT()}" />

                    </h:panelGrid>
                </f:facet>
                <h:panelGrid id="paneListSegnalazioniU" columns="1" border="0"
                    cellpadding="0" cellspacing="0" width="100%"
                    rendered="#{not empty matriceBean.listSegnalazioniUTitoli}">


                    <h:panelGrid id="headerListaSegnalazioni" width="100%" border="0"
                        style="background-color : #bcd0a5;border-bottom: #000000 1px solid;"
                        columns="1" columnClasses="img_title_left,img_title_right">

                        <h:graphicImage url="#{staticPrefix}/images/px.gif" width="4" />

                        <h:form id="form">
                            <p:growl id="msgs" showDetail="true" />
                            <p:dataTable border="0" cellpadding="0" cellspacing="0" rows="20"
                                id="gridSegnalazioniU" editable="true" editMode="cell"
                                widgetVar="cellSegnalazioniU"
                                value="#{matriceBean.listSegnalazioniUTitoli}" var="row">

                                <p:ajax event="cellEdit" listener="#{matriceBean.onCellEdit}"
                                    update=":contentMain:mainForm:matriceView:panelSegnalazioniU:form:msgs" /> 
                                <p:column headerText="codTitoloIsin">
                                    <p:cellEditor>
                                        <f:facet name="output">
                                            <h:outputText value="#{row.codTitoloIsin}" />
                                        </f:facet>
                                        <f:facet name="input">
                                            <p:inputText id="modelInput" value="#{row.codTitoloIsin}" />
                                        </f:facet>
                                    </p:cellEditor>
                                </p:column>

                                <p:column headerText="dscTitolo">
                                    <h:outputText value="#{row.dscTitolo}" />
                                </p:column>

                                <p:column headerText="dscTitolo">
                                    <h:outputText value="#{row.dscTitolo}" />
                                </p:column>

                            </p:dataTable>

                            <p:contextMenu for="gridSegnalazioniU" widgetVar="cMenu">
                                <p:menuitem value="Edit Cell" icon="ui-icon-search"
                                    onclick="PF('cellSegnalazioniU').showCellEditor();return false;" />
                            </p:contextMenu>
                        </h:form>
                    </h:panelGrid>
                </h:panelGrid>
                <h:outputText
                    value="#{messages['fide.matrice.segnalazioniBaseT_non_presenti']}"
                    rendered="#{empty matriceBean.listSegnalazioniUTitoli}" />

            </mofri:panel>

            <mofri:popupConfirm
                msgConfirm="fide.matrice.SegnalazioneT.confirmDelete"
                idPopup="confirmRemoveSegnalazioneT"
                actionConfirmMethod="#{matriceBean.removeSegnalazioneSelected}"
                panelToRefresh="gridSegnalazioniU">
            </mofri:popupConfirm>

        </a4j:region>

    </ui:composition>

在控制台中我有以下错误消息: TypeError:this.jq.on不是函数

PrimeFaces.widget.BaseWidget<.init()
main.jsf:5
PrimeFaces.widget.DataTable<.init()
main.jsf:18
Class.extend/e[d]</<()
main.jsf:5
c()
main.jsf:5
b.createWidget()
main.jsf:1
b.cw()
<anonimo>
main.jsf:1
._Deferred/e.resolveWith()
main.jsf:35
.ready()
main.jsf:24

你有解决方案吗?

由于

0 个答案:

没有答案