You need to sign in to do that
Don't have an account?
Arjunmca
How to pass parameters from VF to controller
Hi,
I have VF page which has 4 check boxes, i want to pass the selected checkbox to controller.
How can i do that?
Can any body help me on this.
Thanks.
Hi
If you are talking about indiviual checkboxes, then define 4 variable in controller class as :
public boolean selectedCheck1 {get;set;}
public boolean selectedCheck2 {get;set;}
public boolean selectedCheck3 {get;set;}
public boolean selectedCheck4 {get;set;}
And use on VF page as :
<apex:inputCheckbox value="{!selectedCheck1}" />
<apex:inputCheckbox value="{!selectedCheck2}" /> and soon
Whenever a checkbox is selected the corresponding variable will be set to true, that you can use in controller class to create the logic.
If you let me know the exact scenario then i can help you out more specific.
Hi Arjun
Click this below link for solution.
How to Pass selected Checkbox values from visualforce page
Retrieve selected checkbox value
there are many ways here is one
Apex:ActionFunction
I ampassing value in field "inputValue" property binded with page.
public Clas testing{
String inputValue{get;set;}
public testing()
{
}
public void dummy()
{
system.debug('=======check==='+inputValue);// it should be testData
}
}
<apex:page controller="testing" >
<apex:form id="frmId">
<apex:actionfunction name="passvalue" action="" >
<apex:param name="param1" value="" assignTo="{!inputValue}"/>
</apex:actionfunction>
<apex:commandbutton Action="{!dummy}" onclick="passvalue('testData')" reRender="frmId" value="submit" />
</apex:form>
</apex:page>