oncomplete is executed after re-rendering has been completed on the client side. Use onbeforedomupdate to execute JS before re-rendering.
but the problem now is it onbeforedomupdate executes before action.
the sequence is
- onsubmit - JS
- server side request processing and action invocation
- response came back
- onbefore dom update js
- dom updates
- oncomplete js
onbeforedomupdate can't be fired before action as it fired only after response came back.
that is ok,
but is there any approach using which i can acchieve my need
first i want to call action-- java function call
and then Rerender
<a4j:button action="server side action" onbeforedomupedate="js function before reRender" reRender="some render zones"/>
It should works just as you menioned.
yes i am doing the same
<a:commandButton action="javafunctioncall" onbeforedomuodate="js function call" Rerender="someid" />
but it execute JS function first, (before action)
please describe carefully what do you mean before action. It can't be like that because called only after request finished(so all the acitons taken place)
You can add a4j:jsFunction called by oncomplete, but this will add one more AJAX request.