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

How to Pass value on check box changed into Contoller



 I have a checkbox on clicking the check box i what to pass the id.

 I m using param but i m unable to get id in controller



<apex:inputCheckbox value="{!radioCheck}">
                      <apex:actionSupport event="onclick"  action="{!UpdateTanent}" rerender="frm"/>
                       <apex:param name="managerid" value="{!}" assignTo="{!getCheckedTenant}"/>                    



getCheckedTenant is coming null in controller.


I have also tried with hidden field


<apex:inputCheckbox value="{!radioCheck}" onclick="sendpasswd('{}'})">
                      <apex:actionSupport event="onclick"  action="{!UpdateTanent}" rerender="frm"/>



<apex:inputHidden value="{!getCheckedTenant}" id="theHiddenInput"/>
       function sendpasswd(val) {
    document.getElementById("{!$Component.frm.theHiddenInput}").value =val;


but getCheckedTenant is coming null in controller.



I Dont know where i m going wrong..!!!!












Use the action function instead of action support on the check box click .


Use the below code snippet as reference:

-------------- VF Page----------------

<apex:page controller="chkactonsupport" >

  <apex:form >

  <apex:inputCheckbox value="{!radioCheck}" onclick="chk()">




  <apex:actionFunction name="callfun" oncomplete="" action="{!UpdateTanent}">  <apex:param name="managerid" value="hello" assignTo="{!getvalue1}"/>  </apex:actionFunction>



  function chk()








----------------- Apex Controller --------------------------


public class chkactonsupport


public string radioCheck{get;set;}

public string getvalue1{get;set;}

public void UpdateTanent()






Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 


To get the parameter to pass from an action support nested in a select list, I had to set immediate to false in the action support. I don't know if it will work with an inputCheckbox though.