1

Im trying to pass values to apex controller from vf page but values are not passing. could you guys please check where im going wrong.

VF PAGE

<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>

APEX Controller:

public static string checkedname{get;set;}    
public void getSelectedInfo(){
    system.debug('Selected name  '+checkedname);
}
2
  • It is likely because the variable checkedname is a static variable. – manjit5190 Oct 26 '20 at 15:42
  • instead of using <input ...>, use an apex:inputText, styled as a radio – cropredy Oct 27 '20 at 22:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.