I got a similar page similar to the following link which is a search function uses paginator using Standardset controller, and I want to make the search records selectable using a checkbox in front of each record (as a new column). How can I do this ?
please refer to the following link for better understanding because my class is a bit too long to post here.
http://www.sfdcpoint.com/salesforce/pagination-using-standard-set-controller-salesforce/
following is my search method which uses standardsetcontroller,
//search variables
public List<Market_Entity__c> marketEntity {get; private set;}
public String searchStringName {get; set;}
public String searchStringPostCode {get; set;}
public String searchStringSPID {get; set;}
public boolean showNewSearchPopup {get; private set;}
public String warningMessage {get; set;}
//paginator variables
public ApexPages.StandardSetController setCon {get;set;}
public Integer noOfRecords {get;set;}
public Integer size {get;set;}
public List<SelectOption> paginationSizeOptions {get;set;}
public void stringSearchValue(){
setCon = null; // Clears the previous search results
if(setCon == null){
size=20; // Default size of records to display for every section
if( searchStringName.length() >=3 || searchStringPostCode.length() >=3 || searchStringSPID.length() >=3 ){
string searchquery = 'SELECT Name, Id, Postcode__c, SPID__c, OrgId__c FROM Market_Entity__c WHERE (Name LIKE \'%'+String.escapeSingleQuotes(searchStringName)+'%\' AND Postcode__c LIKE \'%'+String.escapeSingleQuotes(searchStringPostCode)+'%\' AND SPID__c LIKE \'%'+String.escapeSingleQuotes(searchStringSPID)+'%\') AND OrgId__c = \'SWBS\'';
setCon = new ApexPages.StandardSetController(Database.getQueryLocator(searchquery));
marketEntity = setCon.getRecords();
setCon.setPageSize(size);
noOfRecords = setCon.getResultSize();
warningMessage = Label.No_Result_Found;
if (marketEntity.size() == 0)
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.INFO, Label.No_Result_Found ));
}else{
warningMessage = Label.Search_Text_Characters;
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, Label.Search_Text_Characters));
}
}
}
How can I use a wrapper class to the above method ? I can pass the List of marketEntity to a new wrapper method and use wrapper variable in the page right ? how can I do that ?