Activity Forums Salesforce® Discussions How can we implement pagination in Visualforce page in salesforce?

  • Piyush

    Member
    September 9, 2019 at 5:10 am

    Hi Prachi,

    You can check this code to implement pagination in Visualforce page in salesforce:-

    <apex:page standardController="Opportunity" extensions="oppoNe" recordSetVar="opportunities">
    <apex:pageBlock title="Viewing Opportunities">
    <apex:form id="theForm">
    <apex:pageBlockSection >
    <apex:dataList var="opp" value="{!opportunities}">
    {!opp.Name}
    </apex:dataList>
    </apex:pageBlockSection>
    <apex:panelGrid columns="4">
    <apex:commandLink action="{!first}">FIRST</apex:commandLink>
    <apex:commandLink action="{!next}">NEXT</apex:commandLink>
    <apex:commandLink action="{!previous}">PREVIOUS</apex:commandLink>
    <apex:commandLink action="{!last}">LAST</apex:commandLink>
    </apex:panelGrid>
     
    </apex:form>
    </apex:pageBlock>
    </apex:page>
    public class oppoNe {
     
        public oppoNe(ApexPages.StandardSetController controller) {
            controller.setPageSize(10);
        }
     
    }

     

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos