You need to sign in to do that
Don't have an account?

how to refresh the vf page automatically for every 5 min
I have a Vs page that tracks Planes on the Google earth.
The users would like to have it open all day.
So I need to keep this page refreshing every 5 min or so.
Does anyone have an idea as to how to achieve this functionality? Any help would be greatly appreciated.
Thanks in advance.
All the Apex is eventually generating HTML. So, you can use the Meta tag.
Except use 300 for five minutes instead of 5 seconds as I've got there.
Best, Steve.
All Answers
You can use an actionPoller component for this.
All the Apex is eventually generating HTML. So, you can use the Meta tag.
Except use 300 for five minutes instead of 5 seconds as I've got there.
Best, Steve.
You can use <apex:actionPoller> to refresh the page on a defined interval. A timer that sends an AJAX update request to the server according to a time interval that you specify. The update request can then result in a full or partial page update.
Go through the sample code given below :
/*** Visualforce : ***/
<apex:page controller="exampleCon">
<apex:form>
<apex:outputText value="Watch this counter: {!count}" id="counter"/>
<apex:actionPoller action="{!incrementCounter}" rerender="counter" interval="15"/>
</apex:form>
</apex:page>
Did this answer your question? if so, please mark it solved.
/*** Controller: ***/
public class exampleCon {
Integer count = 0;
public PageReference incrementCounter() {
count++;
return null;
}
public Integer getCount() {
return count;
}
}
Did this answer your question? if so, please mark it solved.
Thank you all for the immediate replies. It works now.