2

Want to create a table using vf which displays 10 records will be displayed in a single page and i need to click on next(or) previous button to view records and records number(1-10,11-20,..) must be displayed in the top of table. If i click on first record it must expand and show "loading image" and must disappear when record appears fully.

  • 2
    What is that you have tried so far? Have you looked into standardSetController? – Sam Jan 31 '14 at 10:38
2

There are a couple of ways for pagination.

  1. One is to look into the pagination in Set Controllers,
  2. or the OFFSET parameter in SOQL queries
  3. If you are comfortable with jQuery you can use the Datatable plugin to get the pagination you want.

Of course in all these cases you would still need to consider different ways to handle the governor limits.

As for the expand on click and loading image, you can very well look into actionstatus tag, and re-render the section where you want the data to show.

1

vf page is

<apex:page standardController="Account" extensions="AccountTabView" >
      <apex:sectionHeader title="Account" subtitle="Details"/>
      <apex:form id="formId">
          <apex:pageBlock title="Account Records">
              <apex:pageBlockTable value="{!accountRecords}" var="ac">
                <apex:column headervalue="Owner Name" value="{!ac.Owner.name}"/>
                <apex:column value="{!ac.name}"/>
              </apex:pageBlockTable>
           </apex:pageBlock>  
       </apex:form>       
    </apex:page>

controller is:

   public class AccountTabView
    {

        public AccountTabView(ApexPages.StandardController controller) 
        {
            accountRecords = new List<Account>();

            accountRecords = [select id,Name,OwnerId,Owner.name from Account];
        }
        String recordId;
        public List<Account> accountRecords{get;set;}

}

Can i create a links to records

now i want to add 2 buttons "previous" and "next" in top of table with records number in top.

If i click on first record it must expand and show "loading image" and must disappear when record appears fully.

If i click on first record it must expand and show "loading image" and must disappear when record appears fully.

  • Can you update your original question, instead of putting this as an answer? – AslamK Feb 3 '14 at 6:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.