1

I tried this and this without luck before posting.

I have a visualforce page that executes a lot of loops and computations based on custom objects and it takes about 6 - 8 seconds for it to load completely. In the meantime, the browser displays a blank page and keeps spinning. Is there a way to show a 'Please be patient while the page loads' message until the results are loaded? I have used actionStatus in the past successfully, but it involved a user clicking on a button on that page. This time it needs to happen on page load automatically. Any pointers? Thank you.

EDIT: Just found this post that matches what I am asking here.

0

2 Answers 2

3

Instead of performing your onload computations in the page constructor or the action event on <apex:page>, you can let the page load without the computations, i.e. have the page load with no information displayed.

Then using the document.ready event in jQuery or window.onload event using plain javacript, call an actionFunction that will call the action on the controller to perform the computations and reRender the page. The actionStatus will work in this case as the page would be already loaded and the actionFunction will invoke the actionStatus before the action is called.

1
  • I see what you are saying. Let me try it out. Thanks! Aug 3, 2015 at 21:01
0

you can use action status as given below.

<apex:actionStatus id="Test" stopText="" onstart="startAjax();" onstop="stopAjax();">
<apex:facet name="start">
    <div>
        <div class="popupBackground" />
        <div class="PopupPanel">
            <table border="0" width="100%" height="100%">
                <tr>
                    <td align="center"><b>Please Wait Message</b></td>
                </tr>
                <tr>
                    <td align="center"><img src="{!$Resource.AjaxLoadPPM}"/></td>
                </tr>
            </table>
        </div>
    </div>
</apex:facet>
</apex:actionStatus>


<apex:actionSupport event="onchange" action="{!your method}" rerender="list" status="Test"/>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .