function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MBouin__35devMBouin__35dev 

dataList only shows 20 records

Hello

 

I am retrieving a list of records through an extension using a custom controller, however the VF pag returns only 20 records even though there are 100+ of them.

I do not understand that as there is no limit specifier in my query.

 

Might be something silly

 

Thnks for the help

 

 Here is my VF page:

<apex:page standardController="Playlist__c" extensions="exo3" recordSetVar="listPlaylists"> <apex:pageBlock title="Viewing Playlits"> <apex:form id="theForm"> <apex:pageBlockSection > <apex:dataList var="p" value="{!listPlaylists}" type="1" first="0"> {!p.name} </apex:dataList> </apex:pageBlockSection> <apex:panelGrid columns="2"> <apex:commandLink action="{!previous}">Previous</apex:commandlink> <apex:commandLink action="{!next}">Next</apex:commandlink> </apex:panelGrid> </apex:form> </apex:pageBlock> </apex:page>

 

 

Here is the code in the exo3 extension:

public exo3(ApexPages.StandardSetController stdController) {} public ApexPages.StandardSetController setPlaylists {get { if(setPlaylists == null) {setPlaylists = new ApexPages.StandardSetController(Database.getQueryLocator([select name from Playlist__c])); } return setPlaylists ; }set; } public List<Playlist__c> getListPlaylists() { return (List<Playlist__c>) setPlaylists.getRecords(); }

 

 

 

 

 

mtbclimbermtbclimber

StandardSetController shows 20 records per page by default. You just need to add the actions to your page for pagination. Coincidentally this thread I just replied to has a good example: