You need to sign in to do that
Don't have an account?

Standard List Controller
I am new to salesforce. I tried to use the standard list controller. I used teh belwo code but did not get any record on page.
Code-
<apex:page standardController="Account" recordSetVar="accounts" sidebar="false">
<apex:form >
<apex:pageBlock >
<apex:pageBlockTable value="{!Accounts}" var="a">
<apex:column headerValue="Account Name"/>
<apex:outputField value="{!a.Name}"/>
</apex:pageBlockTable>
<apex:pageBlockButtons location="bottom" >
<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>
Code-
<apex:page standardController="Account" recordSetVar="accounts" sidebar="false">
<apex:form >
<apex:pageBlock >
<apex:pageBlockTable value="{!Accounts}" var="a">
<apex:column headerValue="Account Name"/>
<apex:outputField value="{!a.Name}"/>
</apex:pageBlockTable>
<apex:pageBlockButtons location="bottom" >
<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>
You did a simple mistake here. Just compare the below lines with your code you will understand.
Please mark this ans as your solution if it helps you. ENJOY APEX.
-Thanks
Ashlekh Gera
All Answers
You did a simple mistake here. Just compare the below lines with your code you will understand.
Please mark this ans as your solution if it helps you. ENJOY APEX.
-Thanks
Ashlekh Gera
http://www.sfdcpoint.com/salesforce/pagination-using-standard-set-controller-salesforce/
Hope this helps.
@AKG,
Thanks for quick reply.
I am not able to find out mistakes :)
Were these the issue ?
<u><b>
This is code written by you
<apex:column headerValue="Account Name"/> here "/>"
<apex:outputField value="{!a.Name}"/>
Here is my code
<apex:column headerValue="Account Name"> here is ">"
<apex:outputField value="{!a.Name}"/>
</apex:column>
-Thanks
Ashlekh Gera
<apex:column headerValue="Account Name"/>
I got the mistake but did not get the logic behind doing do.
<apex:column value="{!a.Name}" headerValue="Account Name"/>
In this case you cannot use apex:outputField.