apex:actionPoller

A timer that sends an AJAX request to the server according to a time interval that you specify. Each request can result in a full or partial page update.

An <apex:actionPoller> must be within the region it acts upon. For example, to use an <apex:actionPoller> with an <apex:actionRegion>, the <apex:actionPoller> must be within the <apex:actionRegion>.

Considerations When Using <apex:actionPoller>

Example

<!--  Page -->
                        

<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> /*** Controller: ***/

public class exampleCon { Integer count = 0; public PageReference incrementCounter() { count++; return null; } public Integer getCount() { return count; } }

Attributes

Attribute Name Attribute Type Description Required? API Version Access
action ApexPages.Action The action method invoked by the periodic AJAX update request from the component. Use merge-field syntax to reference the method. For example, action="{!incrementCounter}" references the incrementCounter() method in the controller. If an action is not specified, the page simply refreshes. 10.0 global
enabled Boolean A Boolean value that specifies whether the poller is active. If not specified, this value defaults to true. 10.0 global
id String An identifier that allows the component to be referenced by other components in the page. 10.0 global
interval Integer The time interval between AJAX update requests, in seconds. This value must be 5 seconds or greater, and if not specified, defaults to 60 seconds. Note that the interval is only the amount of time between update requests. Once an update request is sent to the server, it enters a queue and can take additional time to process and display on the client. 10.0 global
oncomplete String The JavaScript invoked when the result of an AJAX update request completes on the client. 10.0 global
onsubmit String The JavaScript invoked before an AJAX update request has been sent to the server. 10.0 global
rendered Boolean A Boolean value that specifies whether the component is rendered on the page. If not specified, this value defaults to true. 10.0 global
reRender Object The ID of one or more components that are redrawn when the result of an AJAX update request returns to the client. This value can be a single ID, a comma-separated list of IDs, or a merge field expression for a list or collection of IDs. 10.0 global
status String The ID of an associated component that displays the status of an AJAX update request. See the actionStatus component. 10.0 global
timeout Integer The amount of time (in milliseconds) before an AJAX update request should time out. 10.0 global
© Copyright 2000–2014 salesforce.com, inc. All rights reserved.
Various trademarks held by their respective owners.