While exploring JSF-2.2 in conjunction with PrimeFaces 5.3, I encountered JavaScript event handlers like the one utilized with the onComplete
attribute:
function handleSmptmSaveRequest(xhr, status, args) {
if (args.validationFailed) {
PF('smptmDlgWv').jq.effect("shake", { times : 5 }, 100);
} else {
PF('smptmDlgWv').hide();
}
}
I have a few questions regarding this:
- What are the input variables
xhr, status, args
and where are they declared, and how do they receive their values? Is this the sole handler necessary for managing JSF component events likeonBlur
oronClick
, and where can I access more information on this?- Are there any available resources/documentation for this? Coming from Java SE where everything is thoroughly documented and explained, where should I refer to for JavaScript documentation and guidance?
Edit1: These seem to be Ajax callbacks created by PrimeFaces, which are highlighted here: . However, I am still facing an issue as while the PF showcase provides some examples of implementation, I cannot find detailed documentation for these functions. Therefore, I am adding the ajax tag to my question.