a4j 事件顺序是什么?
a4j:commandLink
或 a4j:commandButton
的事件序列是什么?
是不是:onclick
->actionListner
->oncomplete
->reRender
?
reRender
是否出现在 oncomplete
之前?
action
何时发生?
What is the event sequence of a a4j:commandLink
or a4j:commandButton
?
Is it right: onclick
->actionListner
->oncomplete
->reRender
?
Is reRender
comes before oncomplete
?
When action
happens?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当最终用户单击生成的 HTML 元素时,首先调用
onclick
JavaScript。当 JavaScript 代码不返回false
时,JSF 端中所有关联的ActionListener
实现将按照它们关联的顺序被调用组件。如果侦听器没有抛出任何异常,则将调用真正的操作
。当action
返回成功响应时,reRender
中指定的组件将在客户端更新。最后将调用oncomplete
JavaScript。如果您在客户端和服务器端都有调试器并且知道如何使用它,那么跟踪自己就很容易了。我强烈推荐客户端使用 Firebug,服务器端使用 Eclipse。当然,您也可以使用
alert()
或System.out.println()
进行穷人调试。The
onclick
JavaScript is called the first when the enduser clicks the generated HTML element. When the JavaScript code does not returnfalse
, then all associatedActionListener
implementations in the JSF side will be invoked, in the order of their association with the component. If the listeners haven't thrown any exception, then the realaction
will be invoked. When theaction
returns a successful response, then the components specified inreRender
will be updated in the client side. Finally theoncomplete
JavaScript will be called.It's pretty easy to track yourself if you have a debugger in both the client and server side and know how to use it. I strongly recommend Firebug for the client side and Eclipse for the server side. You can of course also always do poor man's debugging using
alert()
s orSystem.out.println()
s.