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

詳細ページの作成

対応付けアプリケーション作成の最後のステップでは、リストビュー内の取引先の詳細ページを作成します。まず、取引先情報を取得するコントローラを作成します。

1swfobject.registerObject("clippy.codeblock-0", "9");
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17public class customAccountController {
18      private final Account account;
19
20      public customAccountController() {
21            account = [Select Id, Name, Rating, CustomerPriority__c, Description, Phone,
22            BillingStreet, BillingCity, BillingState, BillingPostalCode from Account 
23            where id = :ApexPages.currentPage().getParameters().get('id')];
24      }
25
26      public Account getAccount() {
27            return account;
28      }
29
30      public PageReference save() {
31            update account;
32            return null;
33      }
34}

次に、ユーザがリストビューから選択した取引先の電話番号および評価を表示する Visualforce ページを作成します。このページに iPhone に似たスタイル設定を追加するには、iUI フレームワークの <fieldset> クラスおよび <row> クラスを使用します。

次のコードでは、対応付けアプリケーションの取引先の詳細ページを定義します。

1swfobject.registerObject("clippy.codeblock-1", "9");
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17<apex:page showHeader="false" controller="customAccountController" title="My Account" >
18    <apex:composition template="iuivf" />
19
20    <div class="panel" id="acctDetail" selected="true" style="padding: 10px; 
21      margin-top:-44px" title="Account Information" >
22
23       <h2>{!Account.Name}</h2>
24
25       <fieldset style="margin: 0 0 20px 0;">
26
27          <div class="row">
28             <label>Phone:</label>
29             <input type="text" value="{!Account.Phone}" />
30          </div>
31
32          <div class="row">
33             <label>Rating:</label>
34             <input type="text" value="{!Account.Rating}" />
35          </div>
36
37       </fieldset>
38
39    </div>
40
41</apex:page>