LoginSignup
1

More than 5 years have passed since last update.

standardControllerとrecordSetVar

Last updated at Posted at 2014-03-27

standardControllerで指定したオブジェクトのリストを表示したいときはrecordSetVarで指定すればOK。
デモページとか作るときに便利。

AccountList.page
<apex:page standardController="Account" recordSetVar="accounts" id="page">

    <div id="vf-page">
        <apex:form id="form">
            <apex:pageBlock id="block">
                <apex:pageBlockSection columns="1" id="blockSection">
                    <apex:pageBlockTable value="{!accounts}" var="item" id="blockTable">
                        <apex:column headerValue="{!$ObjectType.Account.Fields.Name.Label}">
                            <apex:outputField value="{!item.Name}" />
                        </apex:column>
                    </apex:pageBlockTable>
                </apex:pageBlockSection>
            </apex:pageBlock>
        </apex:form>
    </div>
</apex:page>

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1