function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
<apex:page Controller="Pagination" > <apex:pageblock > <apex:pageBlockTable value="{!acc}" var="a" id="Detail"> <apex:column value="{!a.name}"/> <apex:column value="{!a.website}"/> <apex:column value="{!a.type}"/> <apex:column value="{!a.description}"/> <apex:column value="{!a.phone}"/> </apex:pageBlockTable> <apex:form > <apex:commandButton value="FirstPage" action="{!firstpage}" reRender="detail" /> <apex:commandButton value="Previous" action="{!Previous}" reRender="Detail" /> <apex:commandButton value="Next Page" action="{!NextPage}" reRender="Detail" /> <apex:commandButton value="Last Page" action="{!LastPage}" reRender="Detail" /> </apex:form> </apex:pageblock> </apex:page>
public class Pagination { private integer totalrec=0; private integer limitsize=10; private integer offsetsize=0; Public pagination(){ totalrec= [select count() from Account]; } public list< Account> getAcc() { list<Account>acc=new list<Account>(); acc=database.query('Select name,Website,type,description,phone from Account limit :limitsize Offset :OffsetSize '); system.debug('Values are'+acc); return acc; } public void firstPage(){ offsetsize=0; } public void previous(){ offsetsize=offsetsize-limitsize; } public void nextpage(){ offsetsize=offsetsize+limitsize; } public void lastpage(){ if(math.mod(totalrec,limitsize)==0) offsetsize=totalrec-limitsize; else offsetsize=totalrec-math.mod(totalrec,limitsize); } public boolean getprev(){ if(offsetsize==0) return true; else return false; } public boolean getnxt(){ if((offsetsize+limitsize)>totalrec) return true; else return false; } }
http://amitsalesforce.blogspot.in/2015/04/pagination-using-standardsetcontroller.html
Thanks
Amit Chaudhary
All Answers
http://amitsalesforce.blogspot.in/2015/04/pagination-using-standardsetcontroller.html
Thanks
Amit Chaudhary
VisualForce Page Controller
Hope this will help you.
Thanks
Muba