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
Shivam DashShivam Dash 

pagination for account objects

i want to do pagination for account object . and all the records shown in that vf page we can edit and save in the same vf page
Best Answer chosen by Shivam Dash
karthikeyan perumalkarthikeyan perumal
Hello, 

Here is the Code for Account Inline Edit with pagination, 

if you want more field to edit add accordingly.
 
<apex:page standardController="Account" recordSetVar="Account" tabStyle="Account">
    <apex:form >
        <apex:pageBlock title="Edit Account" >
            <apex:pageMessages ></apex:pageMessages>
            <apex:pageBlockButtons >
              <apex:commandButton value="Save" action="{!save}"/>
              <apex:commandButton value="Cancel" action="{!cancel}"/>
            </apex:pageBlockButtons>
            <apex:pageBlockTable value="{!Account}" var="Acc">
                <apex:column value="{!Acc.name}"/>
                  <apex:column headerValue="Account Number">
                    <apex:inputField value="{!Acc.AccountNumber}"/>
                  </apex:column>
                  <apex:column headerValue="Phone">
                    <apex:inputField value="{!Acc.Phone}"/>
                  </apex:column>
            </apex:pageBlockTable>
            <apex:panelGrid cellpadding="5" cellspacing="5" columns="5" >
                <apex:commandButton value="|<" action="{!first}"  />
                <apex:commandButton value="<" action="{!previous}" rendered="{!HasPrevious}" />
                <apex:commandButton value=">" action="{!next}" rendered="{!HasNext}" />
                <apex:commandButton value=">|" action="{!last}"  />
                <apex:panelGroup >
                    <apex:outputText value="Records/Page"></apex:outputText>&nbsp;&nbsp;
                    <apex:selectList value="{!PageSize}" size="1">
                        <apex:selectOption itemValue="10" itemLabel="10"></apex:selectOption>
                        <apex:selectOption itemValue="15" itemLabel="15"></apex:selectOption>
                        <apex:selectOption itemValue="20" itemLabel="20"></apex:selectOption>
                    </apex:selectList>&nbsp;&nbsp;
                    <apex:commandButton action="{!NULL}" value="Update Page Size"/>
                </apex:panelGroup>
           </apex:panelGrid>
         </apex:pageBlock>
    </apex:form>
</apex:page>

Hopw this will help you.
Mark Best ANSWER if its works for you. 

Thanks
karthik
 

All Answers

karthikeyan perumalkarthikeyan perumal
Hello, 

Here is the Code for Account Inline Edit with pagination, 

if you want more field to edit add accordingly.
 
<apex:page standardController="Account" recordSetVar="Account" tabStyle="Account">
    <apex:form >
        <apex:pageBlock title="Edit Account" >
            <apex:pageMessages ></apex:pageMessages>
            <apex:pageBlockButtons >
              <apex:commandButton value="Save" action="{!save}"/>
              <apex:commandButton value="Cancel" action="{!cancel}"/>
            </apex:pageBlockButtons>
            <apex:pageBlockTable value="{!Account}" var="Acc">
                <apex:column value="{!Acc.name}"/>
                  <apex:column headerValue="Account Number">
                    <apex:inputField value="{!Acc.AccountNumber}"/>
                  </apex:column>
                  <apex:column headerValue="Phone">
                    <apex:inputField value="{!Acc.Phone}"/>
                  </apex:column>
            </apex:pageBlockTable>
            <apex:panelGrid cellpadding="5" cellspacing="5" columns="5" >
                <apex:commandButton value="|<" action="{!first}"  />
                <apex:commandButton value="<" action="{!previous}" rendered="{!HasPrevious}" />
                <apex:commandButton value=">" action="{!next}" rendered="{!HasNext}" />
                <apex:commandButton value=">|" action="{!last}"  />
                <apex:panelGroup >
                    <apex:outputText value="Records/Page"></apex:outputText>&nbsp;&nbsp;
                    <apex:selectList value="{!PageSize}" size="1">
                        <apex:selectOption itemValue="10" itemLabel="10"></apex:selectOption>
                        <apex:selectOption itemValue="15" itemLabel="15"></apex:selectOption>
                        <apex:selectOption itemValue="20" itemLabel="20"></apex:selectOption>
                    </apex:selectList>&nbsp;&nbsp;
                    <apex:commandButton action="{!NULL}" value="Update Page Size"/>
                </apex:panelGroup>
           </apex:panelGrid>
         </apex:pageBlock>
    </apex:form>
</apex:page>

Hopw this will help you.
Mark Best ANSWER if its works for you. 

Thanks
karthik
 
This was selected as the best answer
Shivam DashShivam Dash
Thanks Karthik ,
This works fine for me .