function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
chaitanya salesforcecrmchaitanya salesforcecrm 

How to write wrapper class for below search page?

public with sharing class Condosearchcontroller { 
   public Condosearchcontroller() {

    }

    public list <Condo__c> Cond {get;set;}  
    public string beds {get;set;} 
    public string baths {get;set;}
    public string squarefootage {get;set;} 
    public Condosearchcontroller(ApexPages.StandardController controller) {  
   }  
   
   public void Search(){
   
   
   string searchquery= 'select name,Beds__c,Baths__c,Square_Footage__c,Initial_List_Price__c from Condo__c where name!=NULL';
         if (!beds.equals(''))
              searchquery+= ' and Beds__c = '+beds+'';
         if (!baths.equals(''))
              searchquery+=  ' and Baths__c = '+baths+'';
         if (!squarefootage.equals(''))
      searchquery+=  ' and Square_Footage__c = '+squarefootage+'';
      
      Cond= Database.query(searchquery);
      //return Cond;
    }
 
Deepak Kumar Reddy RegatteDeepak Kumar Reddy Regatte
public class wrapperCondosearchcontroller {
    public List<Condo__c> Condo__c {get; set;}
public List<Condo__c> getCondo__c() {
        if(Condo__c == null) {
            Condo__c = new List<Condo__c>();
           for(Condo__c: [ name,Beds__c,Baths__c,Square_Footage__c,Initial_List_Price__c from Condo__c where name!=NULL';]) {
               
                Condo__c List.add(new Condo__c (c));
          }
return Condo__c;
public PageReference proces() {
List<Contact> selectedContacts = new List<Contact>();
 for(Condo__c: getCondo__c()) {
          if(Conc.selected == true) {
              selectedCCondo__c.add(Conc.con);
}
 for(Condo__c con: selected) {
            system.debug(con);
        }
      Condo__cList=null; 
        return null;
}
public class cCondo__c {
 public Condo con {get; set;}
       public Boolean selected {get; set;}
public cCondo__c(Condo__c c) {
          con = c;
          selected = false;
}
}
}