You need to sign in to do that
Don't have an account?

How to put Page# of Total Page# in VF?
How do I add Page# of Total Page# in VF custom page? I only able to get Page#, I could not get the other part ( Of Total Page). Any Idea. Thanks
<apex:panelGrid columns="9"> <div id="panel"> <apex:commandLink action="{!first}">First</apex:commandlink> <apex:commandLink action="{!previous}" rendered="{!hasPrevious}">Previous</apex:commandlink> <apex:commandLink action="{!next}" rendered="{!hasNext}">Next</apex:commandlink> <apex:commandLink action="{!last}">Last</apex:commandlink> <apex:outputText value="Page #{!pageNumber}"/> <b>Record :</b> <apex:outputText rendered="{!(setpb.pageNumber * setpb.pageSize) < setpb.ResultSize}" value="{!setpb.pageNumber * setpb.pageSize} OF {!setpb.ResultSize}"></apex:outputText> <apex:outputText rendered="{!(setpb.pageNumber * setpb.pageSize) >= setpb.ResultSize}" value="{!setpb.ResultSize} OF {!setpb.ResultSize}"></apex:outputText> </div> </apex:panelGrid>Extension
public class DispatcherContactNewController { public DispatcherContactNewController(ApexPages.StandardController controller) { this.controller = controller; } private integer offset; // Keeps track of the offset private integer pageSize; // Page size or number of rows public integer totalRecords; // Total number of records public ApexPages.StandardSetController setpb{ get{ if(setpb == null){ setpb = new ApexPages.StandardSetController(Database.getQueryLocator( [SELECT Id, Name, RecordTypeId, Createddate FROM Product_Brief__c ORDER BY Createddate DESC ])); setpb.setPageSize(10); } return setpb; } set; } public List<Product_Brief__c>getpbs(){ return (List<Product_Brief__c>)setpb.getrecords(); } public Boolean hasNext { get { return setpb.getHasNext(); } set; } public Boolean hasPrevious { get { return setpb.getHasPrevious(); } set; } public Integer pageNumber { get { return setpb.getPageNumber(); } set; } public void first() { setpb.first(); } public void last() { setpb.last(); } // returns the previous page of records public void previous() { setpb.previous(); } // returns the next page of records public void next() { setpb.next(); } }
https://help.salesforce.com/apex/HTViewSolution?id=000003705&language=en_US
@ Jason Beal , Now it will break my page. i attached some code. Thanks
<apex:outputText value="{!totalPages }"></apex:outputText>