• Nithesh K
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
I'm getting the error "Constructor not defined: [ApexPages.StandardSetController].<Constructor>(List<StoreFront2.DisplayMerchandise). I want to pass in the list of Products I've constructed in the List<DisplayMerchandise> products; variable. How can I accomplish this? Or is there a better way to code this?  Thanks.
 
public class StoreFront2{

List<DisplayMerchandise> products;


public StoreFront2(){
        ct=new Purchase_Line_Items__c();
        ct2=new Contact();
        flag = false;
        flip = false;
        flag2 = true; 
      
         
    }

public ApexPages.StandardSetController samplePagination{
        get{
            if(samplePagination == null){
                samplePagination = new ApexPages.StandardSetController(products);
                samplePagination.setPageSize(5);
            }
            return samplePagination;
        }
        set;
        
    }

    public class DisplayMerchandise {
        public Merchandise__c merchandise{get; set;}
        public Decimal count{get; set;}
        public Decimal tempCount{get;set;}
        public DisplayMerchandise(Merchandise__c item){
            this.merchandise = item;
            
        }
    }

   public List<DisplayMerchandise> getProducts() {
        if (products == null){
            products = new List<DisplayMerchandise>();
    
            for (Merchandise__c item :
            [SELECT id, name, description__c, price__c
            FROM Merchandise__c
            WHERE Total_Inventory__c > 0]) {
           
            products.add(new DisplayMerchandise(item));
            }
        }
        return products;
    }
}