As of now, I have a vf page with a save button for a form:
<apex:commandButton action="{! saveFields }" value="Save"/>
I now want to be able to specify an onClick
action causing the current window to close/refresh depending on the outcome of the saveFields
action. For that, I thought of calling a js function with the onClick
event like so:
<apex:commandButton action="{! saveFields }" status="busy" value="Save" onclick="saveHandler()"/>
Furthermore, I want to make sure the onclick
event is handled only after the action completes.
Is this the right way to go about it?
onclick
tooncomplete
?