I have a multi-step object load process that uses web callouts to populate detail records for a newly created master object.
I've been able to create a Visualforce page and a controller extension to handle the loading, by making one callout, encoding the result (X records loaded) in a query string parameter, and then having the page reload (to trigger the next step).
I use the action
attribute of the apex:page
tag to kick off the load process. Unfortunately, that means the page doesn't render during the callout which can take a few seconds.
I'm looking for a way I can do the following:
1) Display the rendered page (so I can have a message, "Loading FooBars...").
2) Have a method called automatically (I've considered using JavaScript to call the method, possibly via an onload
callback).
3) Possibly redirect to the same page, with a different query string.
On item #3, I could probably get away with just updating part of the screen (maybe in an apex:actionStatus
) and then triggering the next method via JavaScript, but I'll eventually want to redirect to the standard Detail view for the master object after all steps complete.
Is there a clean way to accomplish this?