jsf*_*ner 4 jsf commandlink jsf-2
我们正在从JSF 1.2迁移到JSF 2.2.6以及RichFaces 4.5.2.面对oncomplete未被调用的问题.在onclick调用JS函数时,JS函数oncomplete不会被调用.这是怎么造成的,我该如何解决?
<h:commandLink ... onclick="ed();" oncomplete="cEd(#{rowIndex});">
Run Code Online (Sandbox Code Playgroud)
确实是有没有这样的属性在<h:commandLink>.你最有可能混淆<a4j:commandLink>这确实有该属性.
你基本上有两个选择:
只需替换<h:commandLink>为<a4j:commandLink>.
<a4j:commandLink ... oncomplete="oncompleteFunction()" />
Run Code Online (Sandbox Code Playgroud)嵌套一个<f:ajax>带有事件处理程序的内部<h:commandLink>.
<h:commandLink ...>
<f:ajax onevent="oneventFunction" /><!-- No parenthesis! -->
</h:commandLink>
Run Code Online (Sandbox Code Playgroud)
function oneventFunction(data) {
if (data.status === "success") {
oncompleteFunction();
}
}
Run Code Online (Sandbox Code Playgroud)提示未来:只需阅读标签文档.链接在第1段.
| 归档时间: |
|
| 查看次数: |
9284 次 |
| 最近记录: |