Visualforce partial page refresh and remoting
Which Visualforce tag calls a controller action from an event, a JavaScript callback or a timer; how reRender, actionStatus, actionRegion and immediate change what is processed and redrawn; the postback order behind setters and getters; and when JavaScript remoting beats actionFunction.
Identify the techniques for using Visualforce to perform actions, partial page refreshes, and asynchronous operations.
~7 min read · 9 practice questions ·
What the exam expects
- Pick the Visualforce component that calls a controller action from a DOM event, from JavaScript code or on a timer, and the one that limits what the server processes.
- Use
reRenderand<apex:actionStatus>for partial refreshes with visible progress, and apply the<apex:actionPoller>rules. - Tell
<apex:actionRegion>fromimmediate="true"when required fields block an AJAX action. - Predict controller behaviour during a postback: setters before actions, getters in no defined order.
- Choose between JavaScript remoting and
<apex:actionFunction>, and fix a broken@RemoteActionmethod.
Key terms: action method (controller logic called from page markup), reRender (the IDs redrawn when an AJAX request returns), action region (the part of the page the server processes), postback (a request back to the same page that runs setters, then the action), JavaScript remoting (calling a static @RemoteAction method from JavaScript with a callback).
Controller types and standard actions are in the Platform Developer guide's Apex for page components: controllers and wire adapters and Placing Lightning components, flows and Visualforce; this unit covers the AJAX layer.
Key facts
<apex:actionSupport>- Detail
- Adds AJAX to another Visualforce component's DOM event
<apex:actionFunction>- Detail
- Defines a JavaScript function; must be inside
<apex:form>; params bound by order
- Detail
- Seconds; 5 or more; default 60; no controller expression
- Detail
- Keeps login sessions alive; page won't time out from inactivity
<apex:actionRegion>- Detail
- Limits what the server processes, not what is redrawn
immediate="true"- Detail
- Skips validation, doesn't update the data model; recommended for cancellation only
- Detail
- Run before any action method
- Detail
- No defined order or call count; keep idempotent
@RemoteAction- Detail
- Static, public or global; no overloads
- Detail
- 30 seconds default, up to 120 seconds
- Detail
- Action method returns the
Continuationobject
Sources for this section (9)
- apex:actionSupportdeveloper.salesforce.com (opens in a new tab)
- apex:actionFunctiondeveloper.salesforce.com (opens in a new tab)
- apex:actionPollerdeveloper.salesforce.com (opens in a new tab)
- apex:actionRegiondeveloper.salesforce.com (opens in a new tab)
- immediate Attributedeveloper.salesforce.com (opens in a new tab)
- Controller Methodsdeveloper.salesforce.com (opens in a new tab)
- Declaring a Remote Methoddeveloper.salesforce.com (opens in a new tab)
- JavaScript Remoting Limitsdeveloper.salesforce.com (opens in a new tab)
- Asynchronous Calloutsdeveloper.salesforce.com (opens in a new tab)
- Why does `immediate="true"` break an action that needs the value the user just entered?
- When should you use `<apex:actionFunction>` rather than `<apex:actionSupport>`?
- What are the interval rules for `<apex:actionPoller>`?
- Why should a Visualforce getter have no side effects?
The questions are free to read. Answers with their sources and self-grading are included with the pack.
Keep reading with the Platform Developer II pack
- Core concepts
- Exam traps
- Worked scenario
The pack includes:
- All 28 lessons of the Platform Developer II guide, with reading progress
- Interactive decision walks and step-by-step sequence steppers
- Inline practice questions and one-click topic practice (9 questions for this lesson)
- An official source cited for every claim
- An AI tutor that answers from the guide
- Unlimited timed practice exams