What is Standard List Controllers?
By using standard standard list controllers we can manage set of records. For every standard controller there exists a standard list controller that allows you to create pages that display and act on a set of records, such as list pages, related lists, and mass action pages. We can associate define standard list controller by using recordSetVar.
<apex:page standardController="Account" <strong><span style="color: #993366;" data-mce-style="color: #993366;">recordSetVar="accounts"</span></strong>>
Standard list controller provides additional four pagination actions. Those are first, last, next and previous.
We can use standard list controllers with the following objects.
Account, Asset, Campaign, Case, Contact, Contract, Idea, Lead, Opportunity, Order, Product2, Solution, User, Custom Objects.
Standard list controller example:
<apex:page standardController="Account" recordSetVar="accounts">
<apex:form >
<apex:pageBlock >
<apex:pageBlockTable value="{!Accounts}" var="a">
<apex:column headerValue="Account Name">
<apex:outputField value="{!a.name}"/>
</apex:column>
</apex:pageBlockTable>
<!-- pagination actions supported by standard list controller -->
<apex:pageBlockButtons >
<apex:commandButton value="First" action="{!first}"/>
<apex:commandButton value="Last" action="{!last}"/>
<apex:commandButton value="Next" action="{!next}"/>
<apex:commandButton value="previous" action="{!previous}"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
I see the buttons but no Account names. Checked that Account table is populated
I see the buttons but no table. Can you please tell me what I am doing wrong?
Thanks. Here is my code:
Sorry for the false message, it worked on Account rows that I created. I was looking for older entries. Thanks
When I click on “Previous” button I am getting the below error
Visualforce Error
Formula Expression is required on the action attributes.
might be code issue. Please check you visualforce page and aapex class
Why does this work only for newly created accounts and not showing any previous accounts?