詳細ページ��作成
対応付けアプリケーション作成の最後のステップでは、リストビュー内の取引先の詳細ページを作成します。まず、取引先情報を取得するコントローラを作成します。
1public class customAccountController {
2 private final Account account;
3
4 public customAccountController() {
5 account = [Select Id, Name, Rating, CustomerPriority__c, Description, Phone,
6 BillingStreet, BillingCity, BillingState, BillingPostalCode from Account
7 where id = :ApexPages.currentPage().getParameters().get('id')];
8 }
9
10 public Account getAccount() {
11 return account;
12 }
13
14 public PageReference save() {
15 update account;
16 return null;
17 }
18}次に、ユーザがリストビューから選択した取引先の電話番号および評価を表示する Visualforce ページを作成します。このページに iPhone に似たスタイル設定を追加するには、iUI フレームワークの <fieldset> クラスおよび <row> クラスを使用します。
次のコードでは、対応付けアプリケーションの取引先の詳細ページを定義します。
1<apex:page showHeader="false" controller="customAccountController" title="My Account" >
2 <apex:composition template="iuivf" />
3
4 <div class="panel" id="acctDetail" selected="true" style="padding: 10px;
5 margin-top:-44px" title="Account Information" >
6
7 <h2>{!Account.Name}</h2>
8
9 <fieldset style="margin: 0 0 20px 0;">
10
11 <div class="row">
12 <label>Phone:</label>
13 <input type="text" value="{!Account.Phone}" />
14 </div>
15
16 <div class="row">
17 <label>Rating:</label>
18 <input type="text" value="{!Account.Rating}" />
19 </div>
20
21 </fieldset>
22
23 </div>
24
25</apex:page>