I\'m just starting out in JSF, looks awesome, but I can\'t seem to figure out this last barrier.
I\'m used to traditional Jquery AJAX function, which is perfect in m
add the onevent="jsFunctionName"
(no brackets) needed to your
and your jsFunctionName
should look like
function openDeleteDevicesDialog(data) {
console.log(data.status); //while ,data.status can be 1)"begin" 2)"complete" 3)"success"
if (data.status === 'begin') {...}
if (data.status === 'complete') {...}
if (data.status === 'success') {...}
}
so you should enter this function 3 times
the onclick of the h:commandButton
is executed before the f:ajax
even begins...)
Note that usually you will execute your code in the when data.status === 'success'
, its when your page is done rendering and your DOM is in its final shape/state
also take a look at BalusC answer over here...