开发者

What is the a4j event sequence?

开发者 https://www.devze.com 2023-03-23 15:42 出处:网络
What is the event sequence of a a4j:commandLink or a4j:commandButton? I开发者_运维知识库s it right: onclick->actionListner->oncomplete->reRender?

What is the event sequence of a a4j:commandLink or a4j:commandButton?

I开发者_运维知识库s it right: onclick->actionListner->oncomplete->reRender?

Is reRender comes before oncomplete?

When action happens?


The onclick JavaScript is called the first when the enduser clicks the generated HTML element. When the JavaScript code does not return false, then all associated ActionListener 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 real action will be invoked. When the action returns a successful response, then the components specified in reRender will be updated in the client side. Finally the oncomplete 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 or System.out.println()s.

0

精彩评论

暂无评论...
验证码 换一张
取 消