I've got a p:commandButton that executes a task and returns a success code. My commandButton includes this line of code:
Code: Select all
oncomplete="handleSaveRequest(xhr, status, args)"
Code: Select all
update="panel1, panel2"
Code: Select all
function handleSaveAircraftRequest(xhr, status, args) {
if(args.success) {
//update panel1
}else{
//update panel2
}//if
}//handleSaveAircraftRequest
</script>
Code: Select all
PrimeFaces.ajax.AjaxRequest('/myPage.jsf',{
source:'form',
update:'table1'
});