Tuesday 29 August 2017

Pagination with a List Controller

You can add pagination to a page using a list controller by utilizing the next and previous actions. For example, if you create a page with the following markup:


<apex:page standardController="Account" recordSetVar="accounts">
   <apex:form >
   <apex:pageBlock title="My Accounts">
   <apex:pageBlockSection >
   <apex:dataList value="{!accounts}" var="a">{!a.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:pageBlock>
   </apex:form>    
</apex:page>


<apex:dataList>

An ordered or unordered list of values that is defined by iterating over a set of data. The body of the <apex:dataList>component specifies how a single item should appear in the list. The data set can include up to 1,000 items.

By default, a list controller returns 20 records on the page. To control the number of records displayed on each page, use a controller extension to set the pageSize.



No comments:

Post a Comment

One particular lead takes how many days to change it's stage from one stage value to another

/*************** Ceated By    : Mohit Dwivedi( KVP Business Solution Pvt Ltd) . Created Date :  Purpose      : This  controller is for Lead ...