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
rohitash yadavrohitash yadav 

Filter not working when checkbox exists in record listing

Hi,

I have added a filter on records. It is not working when I add checkbox in the list.

My visualforce Page
 
<apex:page standardController="Line_Item__c" extensions="LineItemPackagesExtensions" recordSetVar="lineitems" >
	<apex:pageBlock title="Search for Packages">
        	<apex:outputLabel >Packages Category</apex:outputLabel>
		<apex:inputField value="{!prdcat.Product_Category__c}" >
                	<apex:actionSupport event="onchange" rerender="packagesList" action="{!filterPackages}"/>
		</apex:inputField>
            	<apex:outputPanel id="packagesList">
                	<apex:pageBlockTable value="{!Packages}" var="a">
                    		<apex:column value="{!a.Name}"/>
                    		<apex:column value="{!a.Product_Category__c}"/>
                    		<apex:column value="{!a.Cost__c}"/>
                    		<apex:column value="{!a.Stay__c}"/>
                    		<apex:column value="{!a.Activity__c}"/>
                    		<apex:column value="{!a.Description__c}"/>
                	</apex:pageBlockTable>
           	</apex:outputPanel>
        </apex:pageBlock>
</apex:page>

Apex code is:
 
public class LineItemPackagesExtensions {

    public Package__c pkgs;
    public List<Package__c> Packages { get; set; }
    public Package__c prdcat{get;set;}
    


    public LineItemPackagesExtensions(ApexPages.StandardSetController controller) {
        Packages = [SELECT Name,Product_Category__c,Cost__c,Stay__c,Activity__c,Description__c FROM Package__c ];
    }

    public List<Package__c> getPackages(){
        Packages = [SELECT Name,Product_Category__c,Cost__c,Stay__c,Activity__c,Description__c FROM Package__c ];
        return Packages;
    }
    
    public void filterPackages() {
    	Packages = [SELECT Name,Product_Category__c,Cost__c,Stay__c,Activity__c,Description__c FROM Package__c 
           where Product_Category__c=:prdcat.Product_Category__c ];
    }

}

Thanks,
Rohitash