Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
apex:actionRegion
Only the components in the body of the <apex:actionRegion> are processed by the server, thereby increasing the performance of the page.
Use this component to get user input for a controller method that does not correspond to a field on an sObject. Only <apex:inputField> and <apex:outputField> can be used with sObject fields.
Example
1<!-- For this example to render fully, associate the page
2with a valid opportunity record in the URL.
3For example: https://MyDomain_login_URL/apex/myPage?id=001D000000IRt53 -->
4
5<apex:page standardController="Opportunity">
6 <apex:form >
7 <apex:pageBlock title="Edit Opportunity" id="thePageBlock" mode="edit">
8
9 <apex:pageBlockButtons >
10 <apex:commandButton value="Save" action="{!save}"/>
11 <apex:commandButton value="Cancel" action="{!cancel}"/>
12 </apex:pageBlockButtons>
13
14 <apex:pageBlockSection columns="1">
15 <apex:inputField value="{!opportunity.name}"/>
16 <apex:pageBlockSectionItem>
17 <apex:outputLabel value="{!$ObjectType.opportunity.fields.stageName.label}"
18 for="stage"/>
19 <!--
20 Without the actionregion, selecting a stage from the picklist would cause
21 a validation error if you hadn't already entered data in the required name
22 and close date fields. It would also update the timestamp.
23 -->
24 <apex:actionRegion>
25 <apex:inputField value="{!opportunity.stageName}" id="stage">
26 <apex:actionSupport event="onchange" rerender="thePageBlock"
27 status="status"/>
28 </apex:inputField>
29 </apex:actionRegion>
30 </apex:pageBlockSectionItem>
31 <apex:inputfield value="{!opportunity.closedate}"/>
32 {!text(now())}
33 </apex:pageBlockSection>
34
35 </apex:pageBlock>
36 </apex:form>
37</apex:page>Attributes
| Attribute Name | Attribute Type | Description | Required? | API Version | Access |
|---|---|---|---|---|---|
| id | String | An identifier that allows the component to be referenced by other components in the page. | 10.0 | global | |
| immediate | Boolean | A Boolean value that specifies whether the action associated with this component should happen immediately, without processing any validation rules associated with the fields on the page. If set to true, the action happens immediately and validation rules are skipped. If not specified, this value defaults to false. See Use the immediate Attribute Carefully. | 11.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 | |
| renderRegionOnly | Boolean | A Boolean value that specifies whether AJAX-invoked behavior outside of the actionRegion should be disabled when the actionRegion is processed. If set to true, no component outside the actionRegion is included in the AJAX response. If set to false, all components in the page are included in the response. If not specified, this value defaults to true. | 10.0 | global |