9

I am trying with actionFunction's rerender and oncomplete. During my testing, it seems to me that rerender happens before the execution oncomplete method. But is that a guaranteed thing? I don't see that in any existing doc though

2
  • 1
    In my experience it always happens in that order... – Adrian Larson May 28 '15 at 1:38
  • 1
    I have always expected oncomplete to run last and it always has for me. I expect oncomplete to run on complete, so "when everything else is completed". – Dominic May 28 '15 at 6:07
12

The order of operations with an ajax request is:

  1. onClick/onSubmit functions are called
  2. ajax form POST to controller
  3. (wait patiently while controller does work)
  4. response received from Salesforce
  5. onBeforeDomUpdate is called
  6. DOM is updated (using the collection of rerender element names)
  7. onComplete is called
  8. page is ready for the user again

I can't find any Salesforce docs that describe this order, but there may be some reference material available within the JBoss RichFaces framework.

.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.