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
Salvatore ParacuolloSalvatore Paracuollo 

how to show loading image?

Hi,
I am newbie on sfdc: I'm trying to show an icon image when my Vf page is loading: I think I can do it using an action status, but I just founded examples with apex button,how can apply this example to my case? can anyone help me?

thanks : )
Best Answer chosen by Salvatore Paracuollo
JeeTJeeT
<apex:page>

<!-- Use Static resource to store jquery library; You can also use <apex:includeScript /> -->
<script src="/resource/AutoComplete/AutoComplete/js/jquery-1.10.2.js"/></script>
<script>
$('#load_scrl').css('top', $(document).scrollTop() + 200);
 $('.loadingBox').show();
</script>
<!-- Add this div tag inside before form and pageBlock component starts -->
<div id="load_scrl" class="loadingBox loader" style="display:none"> </div>
...
....
.......

<!-- Add this script tag just before the end of page component -->
<script>  $('.loadingBox').hide(); </script>
</apex:page>

 

All Answers

Salvatore ParacuolloSalvatore Paracuollo
p.s.: the visualforce page is called from the custom tab
janardhan mjanardhan m
Try this code.
<apex:commandButton value="Do" reRender="block" status="actStatusId"/> 
 <apex:actionStatus id="actStatusId" >
<apex:facet name="start" > <img src="/img/loading.gif" />Loading...
</apex:facet>
</apex:actionStatus>
JeeTJeeT
<apex:page>

<!-- Use Static resource to store jquery library; You can also use <apex:includeScript /> -->
<script src="/resource/AutoComplete/AutoComplete/js/jquery-1.10.2.js"/></script>
<script>
$('#load_scrl').css('top', $(document).scrollTop() + 200);
 $('.loadingBox').show();
</script>
<!-- Add this div tag inside before form and pageBlock component starts -->
<div id="load_scrl" class="loadingBox loader" style="display:none"> </div>
...
....
.......

<!-- Add this script tag just before the end of page component -->
<script>  $('.loadingBox').hide(); </script>
</apex:page>

 
This was selected as the best answer