この文章は Salesforce 機械翻訳システムを使用して翻訳されました。詳細はこちらをご参照ください。
英語に切り替える

apex:actionRegion

AJAX 要求の生成時に Force.com サーバが処理する必要のあるコンポーネントを区切る Visualforce ページの領域です。<apex:actionRegion> の本文のコンポーネントのみがサーバによって処理されるため、ページのパフォーマンスが向上します。

このコンポーネントを使用して、sObject の項目に対応しないコントローラメソッドのユーザ入力を取得します。sObject 項目で使用できるのは、<apex:inputfield>apex:outfield のみです。

<apex:actionRegion> コンポーネントは要求時にサーバが処理するコンポーネントのみを定義します。要求が完了したときに再表示されるページの領域は定義しません。動作を制御するには、<apex:actionSupport><apex:actionPoller><apex:commandButton><apex:commandLink><apex:tab>、または <apex:tabPanel> コンポーネントの rerender 属性を使用します。

transient キーワードの使用」も参照してください。

1<!-- For this example to render fully, associate the page
2with a valid opportunity record in the URL.
3For example: https://Salesforce_instance/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>

属性

属性名 属性型 説明 必須かどうか API バージョン 通用範囲
id String ページの他のコンポーネントがコンポーネントを参照できるようにする識別子。 10.0 グローバル
immediate Boolean ページの項目に関連付けられている入力規則を処理することなく、このコンポーネントに関連付けられているアクションをすぐに実行するかどうかを指定する boolean 値。true に設定すると、アクションがすぐに実行され、入力規則はスキップされます。指定されていない場合、この値はデフォルトの false に設定されます。 11.0 グローバル
rendered Boolean コンポーネントをページに表示するかどうかを指定する boolean 値。指定されていない場合、この値はデフォルトの true に設定されます。 10.0 グローバル
renderRegionOnly Boolean actionRegion の処理時に actionRegion 外で AJAX が呼び出す動作を無効にするかどうかを指定する boolean 値。true に設定すると、actionRegion 外にあるコンポーネントは AJAX レスポンスには含まれません。false に設定すると、ページのすべてのコンポーネントがレスポンスに含まれます。指定されていない場合、この値はデフォルトの true に設定されます。 10.0 グローバル