Cant seem to find documentation for PrimeFaces.ab function
PrimeFaces.ab({source:'signupForm:signupButton'});
return false;
Can anybody help me with what the code above is meant to do? It has been written against the onclick
of a submit button.
The PrimeFaces.ab function is a shortcut function for PrimeFaces.ajax.AjaxRequest.
//ajax shortcut
ab: function(cfg, ext) {
return PrimeFaces.ajax.AjaxRequest(cfg, ext);
}
The PrimeFaces.ajax.AjaxRequest
can be asynchronous or synchronous.
The AjaxRequest uses the AjaxUtils, which handles all send, process, response, and update.
PrimeFaces.ajax.AjaxRequest = function(cfg, ext) {
cfg.ext = ext;
if(cfg.async) {
return PrimeFaces.ajax.AjaxUtils.send(cfg);
}
else {
return PrimeFaces.ajax.Queue.offer(cfg);
}
}
Passing a cfg (configuration) object to the PrimeFaces.ajax.AjaxUtils.send(cfg), this cfg object has:
Note: I came up with this explanation based on my understanding of the source code.
Also you can refer to this answer, might be helpful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With