I have an ajax commandButton, when i clicked it, it updates the form that i used and call an js function on onclick method.
The problem : a field is invisible at first, i use style="display:none"
forinvisibilty. When i click the button, it updates the form data and display:none is still there. On onclick command i use a js function to change the style="display:none
to style="display:block"
.
here is my js function :
setTimeout(function() {
PF('field').jq.css('display', 'block');
}, delay);
I use delay to wait the update finish its job.
here is my command button :
<p:commandButton ajax="true" update="form" onclick="jsFunc();"</p:commandButton>
But i want to be sure when ajax update finish its job, then i want to call the js function.
What is the best way to do this ?
Thanks in advance.