You need to sign in to do that
Don't have an account?

submit visualforce page when click on apex:selectCheckboxes
Hi All,
I have created multiple checkbox from selectoption. Now I want to submit the form and filter record based on selected checkbox.
Visualforce code:
When I click on any chekbox then getSelectedOrder is not getting called. Can anyone help me.
I have created multiple checkbox from selectoption. Now I want to submit the form and filter record based on selected checkbox.
Visualforce code:
<apex:selectCheckboxes value="{!checkboxSelections}" > <apex:selectOptions value="{!MyCheckboxes}" > <apex:actionSupport event="onclick" action="{!getSelectedOrder}" /> </apex:selectOptions> </apex:selectCheckboxes>APex code:
public PageReference getSelectedOrder() { system.debug('yadav'); return null; } public list<string> checkboxSelections {get;set;} //holds the values of the selected checkboxes public list<selectOption> getMyCheckboxes(){ system.debug('rohiatsh'); //create list of checkboxes list<selectOption> myOptions = new list<selectOption>(); for(integer i=0;i<5;i++){ myOptions.add(new selectOption(string.valueof(i),string.valueof(i))); } return myOptions; }
When I click on any chekbox then getSelectedOrder is not getting called. Can anyone help me.
Action support should be added to selectcheckboxes component instead of selectoptions.
Please give it a try to this code. I will work fine.Please mark it as solved if it helps you.
Thanks,