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
nikkeynikkey 

How to show loading image while Ajax call in Visualforce?

Hi Developers , 

 

Can anyone help me in resolving this issue ?

 

ERROR : the image is not getting display in a page .

 

How to show loading image while Ajax call in Visualforce? OR how to show image in <apex:actionStatus> tag in Visualforce?

 

<apex:page >
 
 <div style="position:absolute;top:20px;left: 50%;">
 
      <apex:actionStatus id="refreshContent" >
 
             <apex:facet name="start" >
 
               <apex:image url="{!$Resource.waterlilies}" />
 
       </apex:facet>
 
      </apex:actionStatus>
 
  </div>
 
</apex:page>

 

Thanks in Advance

nickwick76nickwick76

Hi, 

Assuming your resource exists.

The content of your actionStatus tag will show when you reference it from for example an actionPoller or actionSupport.
The actionSupport tag in the example below is placed within a apex:selectList tag.

 

<apex:actionSupport action="{!someAction}" event="onchange" reRender="someBlock" status="refreshContent"/>

 When selecting something in this list, the apex:image will display while loading.

 

// Niklas