I have the following on a Visualforce page:
<apex:actionFunction action="{!updateName}" name="updateName"/>
<apex:inputField value="{!C.Name}" onChange="processName();"/>
<script>
function processName() {
// Some processing takes place here before action function is invoked.
updateName();
}
</script>
And the updateName
method on my controller:
public PageReference updateAssignee() {
// Update the case name and perform a partial page refresh
return null;
}
However I'd like to run some Javascript after the partial page refresh, I modified my actionFunction invocation code to implement a callback:
function processName() {
updateName( function() {
alert('Name has been updated');
});
}
But it doesn't seem to work. What's the generally accepted way to invoke JS after a partial page refresh? Ideally I'd like to persist a JS global var between it, although I don't know if the state is refreshed after PPRF.