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
Priyanka Reddy 74Priyanka Reddy 74 

cant pass values to apex controller from visualforce using action support

Hi,
Im trying to pass values from vf page to apex controller on selecting radio button can any one help me why values are not passing and what wrong i made.
 
public static string checkedname{get;set;}    
public void getSelectedInfo(){
        system.debug('Selected name  '+checkedname);
    }
 
<apex:repeat value="{!am.names}" var="n"> 
   <td> 
     <input type="radio" name="name"  value="{!n}"/> 
        <apex:actionsupport event="onclick" action="{!getSelectedInfo}">
            <apex:param assignTo="{!checkedname}" name="checkedname" value="{!n}" />
         </apex:actionsupport>
           {!n} 
    </td>
</apex:repeat>

Thanks in advance
AnudeepAnudeep (Salesforce Developers) 
Here is a working example of <apex:param/> with action support
 
<apex:page standardController="Account" extensions="ApexParamController" recordSetVar="accounts">  
  <apex:form >
    <apex:repeat value="{!accounts}" var="account">
    <apex:inputCheckbox>
      <apex:actionSupport event="onchange"
                action="{!doActionSupport}"
                reRender="selectedResultPanel">
        <apex:param id="account" name="accountId" value="{!account.Id}"
              assignTo="{!vfParam}"/>
      </apex:actionSupport>
    </apex:inputCheckbox>
      {!account.Name}<br />
    </apex:repeat>
    <apex:outputPanel id="selectedResultPanel">
      Selected Account : {!vfParam}
    </apex:outputPanel>
  </apex:form>
</apex:page>
 
public class ApexParamController{
  public String vfParam{get; set;}
  public ApexParamController(ApexPages.StandardSetController controller){
    
  }
  public PageReference doActionSupport(){
    // Do Something...
    System.debug('vfParam : ' + vfParam);
    return null;
  }
}