Jsf p:commandLink actionListener在切换到Primefaces 7.0后不再调用

Jsf p:commandLink actionListener在切换到Primefaces 7.0后不再调用,jsf,primefaces,spring-webflow,Jsf,Primefaces,Spring Webflow,我最近更新了我的项目库。 Primefaces 5.2>7.0 myFaces 2.1.13>2.2.12 更新后,的actionListener之一不再被调用。 oncomplete中的javascript代码运行良好,向服务器发送ajax请求并返回良好响应,但未调用actionListener commandLink位于p:dataTable内 并且检查器控制台中没有错误 我的回答如下: 但是没有运气 豆子: public class TestBean { public stati

我最近更新了我的项目库。 Primefaces 5.2>7.0 myFaces 2.1.13>2.2.12

更新后,
的actionListener之一不再被调用。 oncomplete中的javascript代码运行良好,向服务器发送ajax请求并返回良好响应,但未调用actionListener

commandLink位于p:dataTable内

并且检查器控制台中没有错误

我的回答如下: 但是没有运气

豆子:

public class TestBean {

    public static final Logger log = Logger.getLogger(TestBean.class);


    private List<TestDataDto> testData;
    private SubDataDto selectedData;
    private String title;


    public List<TestDataDto> getTestData() {
        return testData;
    }

    public SubDataDto getSelectedData() {
        return selectedData;
    }

    public String getTitle() {
        return title;
    }

    public void loadTestData() {
        this.testData = new ArrayList<>();
        TestDataDto e = new TestDataDto();
        ArrayList<SubDataDto> subDatas = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            SubDataDto dto = new SubDataDto();
            dto.setRowNumber(i + 1);
            dto.setTitle("title " + i + " item");
            dto.setType((i % 2 == 0) ? "Even" : "Odd");
            dto.setAmount((i + 1) * 10000);
            subDatas.add(dto);
        }
        e.setSubDatas(subDatas);
        testData.add(e);
    }

    public void setSelectedDataTitle(String title) {
        this.title = title;
    }

}
公共类TestBean{
公共静态最终记录器log=Logger.getLogger(TestBean.class);
私有列表测试数据;
用于选择数据的私有子数据;
私有字符串标题;
公共列表getTestData(){
返回测试数据;
}
用于获取SelectedData()的公共子数据{
返回所选数据;
}
公共字符串getTitle(){
返回标题;
}
公共void loadTestData(){
this.testData=new ArrayList();
TestDataDto e=新的TestDataDto();
ArrayList子数据集=新的ArrayList();
对于(int i=0;i<10;i++){
SubDataDto dto=新的SubDataDto();
dto.设置行数(i+1);
dto.设置标题(“标题”+i+“项目”);
设置类型((i%2==0)?“偶数”:“奇数”);
dto.设定金额((i+1)*10000);
子数据添加(dto);
}
e、 设置子数据(子数据);
testData.add(e);
}
公共无效集合SelectedDataTitle(字符串标题){
this.title=标题;
}
}
流程:

<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns="http://www.springframework.org/schema/webflow"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.springframework.org/schema/webflow
      http://www.springframework.org/schema/webflow/spring-webflow.xsd">


    <view-state id="test">
        <on-entry>
            <evaluate expression="testBean.loadTestData()"/>
        </on-entry>
    </view-state>


</flow>

xhtml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:sec="http://www.springframework.org/security/sabatags">
<f:view locale="#{themeSwitcherBean.localeCode}">


    <h:head>
        <title>#{msgs['application.title']}  : <ui:insert name="title">#{msgs['empty.page.header']}</ui:insert></title>
        <meta http-equiv="Pragma" content="no-store"/>
        <meta http-equiv="Cache-Control" content="no-store"/>
        <meta http-equiv="Expires" content="-1"/>
        <meta name="viewport" content="width=device-width, initial-scale=1"/>

        <ui:insert name="styles"/>
        <ui:insert name="inHead"/>

        <h:outputScript name="js/number.js" target="head"/>

        <h:outputScript name="js/amountConvertor.js" target="head"/>

        <link type="text/css" rel="stylesheet" media="all"
              href="#{request.contextPath}/resources/css/bootstrap.min.css"/>
        <link type="text/css" rel="stylesheet" media="all"
              href="#{request.contextPath}/resources/css/style.css"/>
        <link type="text/css" rel="stylesheet" media="all"
              href="#{request.contextPath}/resources/css/font-awesome.min.css"/>
        <link type="text/css" rel="stylesheet"
              href="#{request.contextPath}/resources/css/custom-primefaces.css"/>
        <link type="text/css" rel="styl esheet"
              href="#{request.contextPath}#{themeSwitcherBean.directionStyleSheet}"/>
        <link type="text/css" rel="stylesheet"
              href="#{request.contextPath}/resources/css/countdown/jquery.countdown.css"/>
        <!--<link type="text/css" rel="stylesheet"-->
        <!--href="#{request.contextPath}/resources/css/morris.css"/>-->
        <script type="text/javascript"
                src="#{request.contextPath}/resources/js/saba-primefaces-ext.js"></script>
        <script type="text/javascript"
                src="#{request.contextPath}/resources/js/countdown/jquery.plugin.min.js"></script>
        <script type="text/javascript"
                src="#{request.contextPath}/resources/js/countdown/jquery.countdown.min.js"></script>
        <link type="text/css" rel="stylesheet"
              href="#{request.contextPath}/resources/css/sib-reportviewer.css"/>
        <script type="text/javascript"
                src="#{request.contextPath}/resources/js/sib-reportviewer.js"></script>
        <h:outputScript library="js" name="jquery.ui.datepicker.js"
                        rendered="#{themeSwitcherBean.localeCode == 'FA' or themeSwitcherBean.localeCode == 'fa'}"/>
        <h:outputScript library="js" name="jquery.ui.datepicker-cc.all.min.js"
                        rendered="#{themeSwitcherBean.localeCode == 'FA' or themeSwitcherBean.localeCode == 'fa'}"/>
        <h:outputScript library="js" name="jquery.ui.datepicker-fa.js"
                        rendered="#{themeSwitcherBean.localeCode == 'FA' or themeSwitcherBean.localeCode == 'fa'}"/>

        <h:outputScript library="js" name="raphael-min.js"/>
        <h:outputScript library="js" name="morris-0.4.1.min.js"/>
        <h:outputScript library="js" name="moment.js"/>
        <h:outputScript library="js" name="moment-jalaali.js"/>
    </h:head>


    <p:panel id="accountOverviewPanel" styleClass="tab-content">
        <h:form id="form">
        <h:inputHidden value="#{tabCheckBean.tabId}" id="form_client_id" readonly="true">
            <f:param name="name" value="_client_id"/>
        </h:inputHidden>
        <p:dataTable reflow="false" id="dataTable" var="data"
                     styleClass="table-bordered table-striped table-condensed cf"
                     value="#{testBean.testData}"
                     selection="#{testBean.selectedData}"
                     selectionMode="single"
                     currentPageReportTemplate="#{msgs['primefaces.currentPageReportTemplate']}"
                     emptyMessage="#{msgs['primefaces.datagrid.no.data']}"
                     paginator="true"
                     paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                     rowsPerPageTemplate="5,10,15" lazy="true"
                     rows="10"
                     rowIndexVar="rowNum">

            <p:columnGroup type="header">
                <p:row>
                    <p:column headerText="RowNum"/>
                    <p:column headerText="Title"/>
                    <p:column headerText="Type"/>
                    <p:column headerText="Amount"/>
                    <p:column headerText="Actions"/>
                </p:row>
            </p:columnGroup>

            <p:subTable id="subData" var="sub" value="#{data.subDatas}">
                <p:column>
                    <h:outputText value="#{sub.rowNumber}"/>
                </p:column>

                <p:column>
                    <h:outputText value="#{sub.title}"/>
                </p:column>
                <p:column>
                    <h:outputText value="#{sub.type}"/>
                </p:column>
                <p:column>
                    <h:outputText value="#{sub.amount}"/>
                </p:column>

                <p:column>
                    <p:commandLink title="Show Data"
                                   actionListener="#{testBean.setSelectedDataTitle(sub.title)}"
                                   oncomplete="PF('subTitleDlg').show()"
                                   update=":subTitleDialog" ajax="true">
                        <p:graphicImage value="/resources/img/save.png"/>
                    </p:commandLink>
                </p:column>
            </p:subTable>
        </p:dataTable>
        </h:form>

    </p:panel>

    <p:dialog id="subTitleDialog" widgetVar="subTitleDlg" dynamic="true"
              modal="true" closable="true" closeOnEscape="true"
              width="450" visible="false">
        <br/>
        <p:outputLabel value="selected title is : "/>

        <div style="text-align: left;">
            <p:outputLabel value="#{testBean.title}"/>
        </div>
    </p:dialog>

</f:view>
</html>

#{msgs['application.title']}:#{msgs['empty.page.header']}

当我点击SaveCommandLink时,我希望执行actionListener,然后打开对话框并显示所选的标题

我已经在目标方法中添加了一个断点,但是没有发生任何事情


知道如何找到问题并解决它吗?

显然commandLink在数据表中有问题。 尝试h:commandLink也无法解决问题

所以我不得不做一个小把戏,让它再次发挥作用

我在dataTable之外的表单中添加了一个隐藏的输入,然后在commandLink的click事件中更新了它的值,并设置commandLink来处理它。 变化如下所示:

    <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
>
<f:view>


    <h:head>
        <title>#{msgs['application.title']}  : <ui:insert name="title">#{msgs['empty.page.header']}</ui:insert></title>
        <meta http-equiv="Pragma" content="no-store"/>
        <meta http-equiv="Cache-Control" content="no-store"/>
        <meta http-equiv="Expires" content="-1"/>
        <meta name="viewport" content="width=device-width, initial-scale=1"/>

        <ui:insert name="styles"/>
        <ui:insert name="inHead"/>

        <h:outputScript name="js/number.js" target="head"/>
        <!--<h:outputScript name="js/jquery-3.2.1.min.js" target="head"/>-->
        <h:outputScript name="js/amountConvertor.js" target="head"/>
        <!--<h:outputScript name="js/bootstrap.min.js" target="head"/>-->
        <!--<h:outputScript name="js/custome.js" target="head"/>-->
        <!--<script type="text/javascript"-->
        <!--src="#{themeSwitcherBean.applicationPath}/resources/js/custome.js"></script>-->


        <link type="text/css" rel="stylesheet" media="all"
              href="#{themeSwitcherBean.applicationPath}/resources/css/bootstrap.min.css"/>
        <link type="text/css" rel="stylesheet" media="all"
              href="#{themeSwitcherBean.applicationPath}/resources/css/style.css"/>
        <link type="text/css" rel="stylesheet" media="all"
              href="#{themeSwitcherBean.applicationPath}/resources/css/font-awesome.min.css"/>
        <link type="text/css" rel="stylesheet"
              href="#{themeSwitcherBean.applicationPath}/resources/css/custom-primefaces.css"/>
        <link type="text/css" rel="stylesheet"
              href="#{themeSwitcherBean.applicationPath}#{themeSwitcherBean.directionStyleSheet}"/>
        <link type="text/css" rel="stylesheet"
              href="#{themeSwitcherBean.applicationPath}/resources/css/countdown/jquery.countdown.css"/>
        <!--<link type="text/css" rel="stylesheet"-->
        <!--href="#{themeSwitcherBean.applicationPath}/resources/css/morris.css"/>-->
        <script type="text/javascript"
                src="#{themeSwitcherBean.applicationPath}/resources/js/saba-primefaces-ext.js"></script>
        <script type="text/javascript"
                src="#{themeSwitcherBean.applicationPath}/resources/js/countdown/jquery.plugin.min.js"></script>
        <script type="text/javascript"
                src="#{themeSwitcherBean.applicationPath}/resources/js/countdown/jquery.countdown.min.js"></script>
        <link type="text/css" rel="stylesheet"
              href="#{themeSwitcherBean.applicationPath}/resources/css/sib-reportviewer.css"/>
        <script type="text/javascript"
                src="#{themeSwitcherBean.applicationPath}/resources/js/sib-reportviewer.js"></script>
        <h:outputScript library="js" name="jquery.ui.datepicker.js"
                        rendered="#{themeSwitcherBean.localeCode == 'FA' or themeSwitcherBean.localeCode == 'fa'}"/>
        <h:outputScript library="js" name="jquery.ui.datepicker-cc.all.min.js"
                        rendered="#{themeSwitcherBean.localeCode == 'FA' or themeSwitcherBean.localeCode == 'fa'}"/>
        <h:outputScript library="js" name="jquery.ui.datepicker-fa.js"
                        rendered="#{themeSwitcherBean.localeCode == 'FA' or themeSwitcherBean.localeCode == 'fa'}"/>

        <h:outputScript library="js" name="raphael-min.js"/>
        <h:outputScript library="js" name="morris-0.4.1.min.js"/>
        <h:outputScript library="js" name="moment.js"/>
        <h:outputScript library="js" name="moment-jalaali.js"/>
    </h:head>


    <p:panel id="accountOverviewPanel" styleClass="tab-content">
        <h:form id="form">
            <h:inputHidden value="#{tabCheckBean.tabId}" id="form_client_id" readonly="true">
                <f:param name="name" value="_client_id"/>
            </h:inputHidden>
            <p:inputText type="hidden" widgetVar="selectedDataTitleWgt" id="selectedDataTitle"/>
            <p:dataTable reflow="false" id="dataTable" var="data"
                         styleClass="table-bordered table-striped table-condensed cf"
                         value="#{testBean.testData}"
                         selection="#{testBean.selectedData}"
                         selectionMode="single"
                         currentPageReportTemplate="#{msgs['primefaces.currentPageReportTemplate']}"
                         emptyMessage="#{msgs['primefaces.datagrid.no.data']}"
                         paginator="true"
                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                         rowsPerPageTemplate="5,10,15" lazy="true"
                         rows="10"
                         rowIndexVar="rowNum">

                <p:columnGroup type="header">
                    <p:row>
                        <p:column headerText="RowNum"/>
                        <p:column headerText="Title"/>
                        <p:column headerText="Type"/>
                        <p:column headerText="Amount"/>
                        <p:column headerText="Actions"/>
                    </p:row>
                </p:columnGroup>

                <p:subTable id="subData" var="sub" value="#{data.subDatas}">
                    <p:column>
                        <h:outputText value="#{sub.rowNumber}"/>
                    </p:column>

                    <p:column>
                        <h:outputText value="#{sub.title}"/>
                    </p:column>
                    <p:column>
                        <h:outputText value="#{sub.type}"/>
                    </p:column>
                    <p:column>
                        <h:outputText value="#{sub.amount}"/>
                    </p:column>

                    <p:column>
                        <p:commandLink title="Show Data"
                                       onclick="PF('selectedDataTitleWgt').jq.val('#{sub.title}');"
                                       process=":form:selectedDataTitle"
                                       ajax="true">
                            <p:graphicImage value="/resources/images/save.png"/>
                        </p:commandLink>
                    </p:column>
                </p:subTable>
            </p:dataTable>
        </h:form>

    </p:panel>


</f:view>
</html>

#{msgs['application.title']}:#{msgs['empty.page.header']}

请补充,这不是一个问题。或者,如果您从页面中删除一个ccs或js文件,它是否有效?或一列或子表或回流或。。。?或者当您不使用SpringFlow时,我无法删除SpringWebFlow。但我将尝试删除外部CSSE。虽然我不明白这有什么关系。因为ajax调用正在进行,但是没有进入我的方法,为什么您不能为一个不删除SpringWebFlow的应用程序做准备?你可以有1000%的把握。。。并删除用户界面:插入和更多。。。可以删除对话框等以及dto之间的父子关系,并用java
KeyPair