Recently when I doing <f:ajax> inside JSF 2.0, I specify onevent javascript callback function, when f:ajax execute to the server and return to the client, it will call the javascript callback function. But I discovered that it will call the function three times. Afterwards when I checked the Javascript Console Log in Google, I discovered onevent will have three different status when it called the function.
The status are: begin, complete, success.
Therefore, the problem has known. We just have to define an onevent callback function as below.
function onevent(e) {
if(e.status == ‘success’) {
// TODO: your business
}
}
Hi,
I recently used the onevent function for a UI block call and even i was confused how it worked. The status changes are actually helpful for us to call different actions on different times gap.
Rgds,
Gayan
Ha, we are on the same boat. Thanks for your sharing.
Thanks, it was very useful.