Working for pagination on custom object record, using StandardSetController everything initialized but it is giving error that
Error: Compile Error: Unexpected token 'return'. at getAgentAsset Method
Controller code
public class PaginationController{
Public Integer size{get;set;}
Public Integer noOfRecords{get; set;}
public List<SelectOption> paginationSizeOptions{get;set;}
public PaginationController(){
size=10;
paginationSizeOptions = new List<SelectOption>();
paginationSizeOptions.add(new SelectOption('5','5'));
paginationSizeOptions.add(new SelectOption('10','10'));
paginationSizeOptions.add(new SelectOption('20','20'));
paginationSizeOptions.add(new SelectOption('50','50'));
paginationSizeOptions.add(new SelectOption('100','100'));
}
public ApexPages.StandardSetController setCon {
get {
if(setCon == null) {
setCon = new ApexPages.StandardSetController(Database.getQueryLocator(
[select Firstname__c,Lastname__c,Primary_AgentID__c,spg__c,CloseDate__c, from Agent_Asset__c where isActive__c = true order by createddate desc]));
setCon.setPageSize(size);
noOfRecords = setCon.getResultSize();
}
return setCon;
}
set;
}
public PageReference refreshPageSize() {
setCon.setPageSize(size);
return null;
}
public List<Agent_Asset__c > getAgentAsset() {
return (List<Agent_Asset__c >) setCon.getRecords();
}
}