Friday, November 08, 2019

Loading Status in Visualforce Page without Apex Class

The loading status is the spinning ... the in progress ...the glass hour thingy or whatever you want to call it as long the purpose is to prevent user to perform any action before the previous action is completed.


  • use action:status
  • no controller class required
  • if you are using with  apex:command tag, put rerender if not the loading status will not work

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  <style>
                .spinnerBg{
                    width: 100%;
                    height: 100%;
                    position: absolute;
                    background-color: #000;
                    opacity: 0.2;
                    z-index: 999999;
                }
                .spinner{
                    width: 100%;
                    height: 100%;
                    position: absolute;
                    background-image: url("/img/loading32.gif");
                    background-size: 16px;
                    background-repeat: no-repeat;
                    background-attachment: fixed;
                    background-position: center;
                    z-index: 9999999;
                    opacity: 1;
                }
   </style>
   
    <apex:actionStatus id="spinnerStatus">    
                    <apex:facet name="start">
                     <div class="spinnerBg" />
                    <div class="spinner" />
                </apex:facet>
    </apex:actionStatus>
   
     <apex:commandButton action="{!save}" value="Save" status="spinnerStatus" reRender="theForm"/>

No comments:

Post a Comment