gpt4 book ai didi

jsf - h :commandLink not invoked 的 oncomplete 属性

转载 作者:行者123 更新时间:2023-12-05 00:21:35 25 4
gpt4 key购买 nike

我们正在从 JSF 1.2 迁移到 JSF 2.2.6 以及 RichFaces 4.5.2。面对 oncomplete 的问题没有被调用。 onclick期间的JS函数被调用,但 JS 在 oncomplete不会被调用。这是怎么引起的,我该如何解决?

<h:commandLink ... onclick="ed();" oncomplete="cEd(#{rowIndex});">

最佳答案

There is indeed no such attribute<h:commandLink> .您很可能会混淆 <a4j:commandLink>其中does have that attribute .

你基本上有两个选择:

  • 只需更换 <h:commandLink>来自 <a4j:commandLink> .
    <a4j:commandLink ... oncomplete="oncompleteFunction()" />
  • 嵌套一个 <f:ajax>里面有一个事件处理程序 <h:commandLink> .
    <h:commandLink ...>
    <f:ajax onevent="oneventFunction" /><!-- No parenthesis! -->
    </h:commandLink>


    function oneventFunction(data) {
    if (data.status === "success") {
    oncompleteFunction();
    }
    }

  • 对 future 的提示:只需阅读标签文档。链接在第一段。

    关于jsf - h :commandLink not invoked 的 oncomplete 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31266604/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com