a4j:commandbutton within f:ajax nested 不执行oncomplete
a4j:commandbutton within f:ajax nested does not execute oncomplete
正如您在下面看到的,我有一个 f:ajax 嵌套在 a4j:commandLink 中,类似于我读到的 here 以解决 saving-on-db 问题.
现在,当我单击 commandLink 时,永远不会调用 oncomplete。这意味着,模式不会关闭并且光标保持 "waiting" 模式。如果我删除 f:ajax,则会调用 oncomplete,但会返回保存数据库。
我已经尝试了几件事,但没有一个真正奏效。无论如何这里可能是什么问题?
提前致谢
<a4j:commandLink value="#{msg.label_accept}"
onclick="this.disabled=true; document.body.style.cursor='wait';"
action="#{backingBeanRef['select']}"
oncomplete="this.disabled=false; document.body.style.cursor='auto';closeModal('modalDocumentationCenter');"
styleClass="btn btn-default btn-einvoice"
render="@this">
<f:ajax execute="inputTitle inputDescription"/>
</a4j:commandLink>
a4j:commandLink
已经 ajax。所以直接使用 a4j:commandLink
中的 execute
。不要使用其他 ajax 标签。您不能(或者,当然,您不应该)同时使用两者。
或者我你真的想用f:ajax
,那就用h:commandLink
代替a4j:commandLink
。
PS。您可以尝试使用 a4j:ajax
,但我很确定结果与 f:ajax
.
相同
正如您在下面看到的,我有一个 f:ajax 嵌套在 a4j:commandLink 中,类似于我读到的 here 以解决 saving-on-db 问题.
现在,当我单击 commandLink 时,永远不会调用 oncomplete。这意味着,模式不会关闭并且光标保持 "waiting" 模式。如果我删除 f:ajax,则会调用 oncomplete,但会返回保存数据库。
我已经尝试了几件事,但没有一个真正奏效。无论如何这里可能是什么问题?
提前致谢
<a4j:commandLink value="#{msg.label_accept}"
onclick="this.disabled=true; document.body.style.cursor='wait';"
action="#{backingBeanRef['select']}"
oncomplete="this.disabled=false; document.body.style.cursor='auto';closeModal('modalDocumentationCenter');"
styleClass="btn btn-default btn-einvoice"
render="@this">
<f:ajax execute="inputTitle inputDescription"/>
</a4j:commandLink>
a4j:commandLink
已经 ajax。所以直接使用 a4j:commandLink
中的 execute
。不要使用其他 ajax 标签。您不能(或者,当然,您不应该)同时使用两者。
或者我你真的想用f:ajax
,那就用h:commandLink
代替a4j:commandLink
。
PS。您可以尝试使用 a4j:ajax
,但我很确定结果与 f:ajax
.