• Aftab Alam 5
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
who will execute first - StandardControler OR extension Custom controller with same method name ?? Such as in page we are calling method {!save} 
Hi Iam trying to do paination using offset keyword next button is working but previous button in not working..


<apex:page controller="trpaginationoffsetContrller">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockSection >
                <apex:pageBlockTable value="{!ConList}" var="con">
                    <apex:column value="{!con.Name}"/>
                    <apex:column >
                        <table  width="100%">                
                  <apex:repeat value="{!ConList}" var="ContactSelec">
                  <tr><td>{!ContactSelec.FirstName}</td> <td>{!ContactSelec.LastName }</td></tr>
                  </apex:repeat>
                  </table>
                    </apex:column>
                   
                </apex:pageBlockTable>
            </apex:pageBlockSection>
           
            <apex:commandButton value="Previous" action="{!Previous}"/>
           
           
            <apex:commandButton value="Next" action="{!Next}"/>
           
        </apex:pageBlock>
    </apex:form> 
</apex:page>

--------------------------------------------------------------------------------------------

public class trpaginationoffsetContrller {
    public List<Contact> ConList {get;set;}
    public Integer Counter = 0;
    public trpaginationoffsetContrller(){
       
        //ConList = new List<Contact>
        ConList = [select Id, Name,FirstName, LastName  from Contact ORDER BY name Limit 10 OFFSET 0];
    }
    public void Next(){
        Counter ++;
        //ConList = new List<Contact>
        ConList = [select Id, Name,FirstName, LastName from contact ORDER BY name
                   Limit 10 OFFSET 10
                  ];
        update ConList;
    }
    public void Previous(){
        counter --;
        conList = [select Id, Name,FirstName, LastName from Contact ORDER BY name limit 50 OFFSET 10]; 
        update ConList;
    }
}
and can you help me Account Names diplay its related contacts only in VF page