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

implementing pagination in a visualforcepage having available page numbers as links

I want to implement pagination in my visualforcepage on a custom object using a custom controller,with a limit of about 10 records per page and having all the pagenumbers and prevoius and next and lastpage links like:


first,next,1,2,3...Lastpage....  links...


Can any body pls help...




Yoganand GadekarYoganand Gadekar



Go through this component for pagination,

Just pass the list of records to this component... your table will be available with pagination applied...


HIT KUDOS and mark this as answer if it helps you.




Thanks for sharing the solution..but  the requirement as I mentioned,page should have the page no's along with this next,previous,last links...


calculating  the no of pages required to display, based on the records retrieved from the list and based on the records size limit on each page and displaying all the page no's as command link's.suppose i have 200 records in my list and my record size is 25 per page then ill have 8 pages having first 25 in pag1,nxt 25 in pag2,nxt 25 in pg3.......  along wid this next,last,previous links...




Some thing like that?

VF page
<apex:commandLink action="{!first}" value="First" rerender="SomeThing"/>
<apex:commandLink action="{!previous}" value="Prev" rerender="SomeThing"/>
<apex:commandLink action="{!next}" value="Next" rerender="SomeThing"/>
<apex:commandLink action="{!last}" value="Last" rerender="SomeThing"/>

    public PageReference next() {
                return null;
    public PageReference last() {
        return null;
    public PageReference first() {
        return null;
    public PageReference previous() {
        return null;

on page numbers you can use action like setCon.setPageNumber(XX)