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
}
}