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
Michael_JohnsonMichael_Johnson 

Apex Repeat Bug?

Hi All,

 

I am having an issue with apex repeat displaying a list of records. My query is retrieving 23 rows but only 20 are being displayed. 

 

Here is the actual Apex query

 

 

 public ApexPages.StandardSetController setCon2 {

        get {

            if(setCon2 == null && ModuleId != null) {

             setCon2 = new ApexPages.StandardSetController([Select Id, IMAX_URL__c, IMAX_APIKey__c, IMAX_Version__c, PCMX_Version__c from Module__c where Id =: ModuleId LIMIT 1]);

            }

            return setCon2;

        }

        set;

    }  

 

    public list<IMAX_Device__c> getDevices() {

         if(ModuleId != null && setCon != null){

          return (List<IMAX_Device__c>) setCon.getRecords();

         }else{

          return null;

         }

    }

 

 

Here is the Visualforce repeat

 

 

<apex:repeat var="d" value="{!devices}"> 
<div class="middle"> 
  <div class="innermiddle"><span id="{!d.Id}" class="{!d.Active__c}"><apex:inputcheckbox value="{!d.Active__c}" id="checkbox" onclick="setCheckboxDisplay(this,'{!d.Id}'),saveDevices(),setTimeout('rerendermessages()',5000)" styleClass="styledCheckbox"/></span><span style="margin-left:1px;"><apex:inputtext styleclass="rounded3" value="{!d.Device_Name__c}" size="9"/></span> 
    <span style="margin-left:0px;"><apex:inputtext styleclass="rounded2" value="{!d.Name}" size="17"/></span> 
    <span style="margin-left:0px;;"><apex:commandlink styleclass="history" value="History" action="{!nullaction}" rerender="loginhistory"><apex:param name="deviceid" value="{!d.id}" /></apex:commandlink></span> 
    <span style="margin-left:1px;"><apex:commandlink styleclass="delete" action="{!delRow}" value="Delete" oncomplete="reloadwindow()"><apex:param name="delid" value="{!d.Id}"/> 
    </apex:commandlink> </span> </div>
</div>
</apex:repeat> 
The debug log shows 23 rows retrieved yet only 20 device lines are displayed on the screen below. Anyone have any ideas?
13:15:53.180|SOQL_EXECUTE_BEGIN|[22]|Aggregations:0|select Id, Active__c, Device_Name__c, Name from IMAX_Device__c where Module__c =: ModuleId and isDeleted = false order by CreatedDate asc
13:15:53.186|SOQL_EXECUTE_END|[22]|Rows:23

 

Best Answer chosen by Admin (Salesforce Developers) 
hgarghgarg

I guess you are setting the Page size 20 in standard set controller, then it will show 20 records on the page at once and rest of records it should show on  Next.

All Answers

hgarghgarg

I guess you are setting the Page size 20 in standard set controller, then it will show 20 records on the page at once and rest of records it should show on  Next.

This was selected as the best answer
Michael_JohnsonMichael_Johnson

Thanks, that was it. I did not specify a page size so I assume it is by default 20.