public with sharing class Pagination {
Public Integer noOfRecords{get; set;}
Public Integer size{get;set;}
public class AccountWrapper
{
public Account acc {get;set;}
public Boolean isSelected{get;set;}
public AccountWrapper(Account a,Boolean s)
{
acc=a;
isSelected=s;
}
}
public ApexPages.StandardSetController setCon {
get{
if(setCon == null){
size = 10;
setCon = new ApexPages.StandardSetController(accounts); // error on this line
setCon.setPageSize(size);
noOfRecords = setCon.getResultSize();
}
return setCon;
}set;
}
Public List<AccountWrapper> getAccounts(){
List<AccountWrapper> accList = new List<AccountWrapper>();
for(Account a : [Select Name, Type, BillingCity, BillingState, BillingCountry from Account order by Name]);
accList.add(new AccountWrapper(a,false));
return accList;
}
}
I am not able to pass the list of wrapper to StandardSetController. Facing issue with line.
setCon = new ApexPages.StandardSetController(accounts);