function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
@rajeshdulhai@rajeshdulhai 

how to show the page is loading on the click of the button in visualforce

i have four tabs developed on my visualforce page with two buttons on each page i.e previous and next button . i want to have a functionality on click of previous and next button to show the user that the page is loading until the page is fully loaded . how can this be done ?

Thanks in advance

Rahul AgarwalRahul Agarwal

In the button use Status tag. For ex:

 

<apex:commandButton action="{!save}" value="Save" id="theButton" status="counterstatus"/>

 

then put the following code whereever you want to show the loading image - 

 

<apex:actionStatus id="counterStatus">
<apex:facet name="start">
<center>
<img src="/img/loading32.gif" />
</center>
</apex:facet>
</apex:actionStatus>

 

Hit Kudos if this works.

 

Cheers!!!

Satish PrajapatSatish Prajapat
Hello All,
<apex:page>
 <apex:form id=”formId” >
 ……
 <apex:actionStatus id=”status”>
 <apex:facet name=”start”>
 <div style=”position: fixed; top: 0; left: 0; right: 0; bottom: 0; opacity: 0.75; z-index: 1000; background-color: grey;”>
 &nbsp;
  </div>
 <div style=”position: fixed; left: 0; top: 0; bottom: 0; right: 0; z-index: 1001; margin: 22% 42%”>
  <img src=”{!$Resource.loader_logo}” width=”80" height=”80" / >
 </div>
 </apex:facet>
 </apex:actionStatus>
 ……….
 ……….
 <apex:commandButton value=”Insert Report” action=”{!insertData}” >
 <apex:actionSupport event=”onclick” status=”status” reRender=”formId” />
 </apex:commandButton>
 …………….
 </apex:form>
</apex:page>

Enjoy my Dost...!!!
Satish.