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
mike1051mike1051 

Associating radio button with controller wrapper class..?

I need to get the associated record. i.e with the radio button.I am using input type radio button for the same.please someone help with the code...

 

 

<apex:column >
    <apex:facet name="header">
        Action
    </apex:facet>
    <input type="radio" name="selection" value="{!m.isSelected}" /> 

 </apex:column>

<apex:column value="{!m.meet.Subject__c}">
    <apex:facet name="header">
        Subject
    </apex:facet>
</apex:column>

 

<apex:commandButton value="Invite To Meeting" action="{!inv}"/>

 wrapper class

public list<meetInviteWrapper> meetwrapperlist{get;set;}
    public class meetInviteWrapper
    {
        public meeting__c meet{get;set;}
        public Boolean isSelected{get;set;}
        public meetInviteWrapper(meeting__c m)
        {
            meet=m;
            isSelected=false;
        }



 public void inv()
    {
    List<meeting__c> mList=new List<meeting__c>();
        for(meetInviteWrapper miw:meetwrapperlist)
        {
            if(miw.isSelected)
            {
                mList.add(miw.meet);
            }

        }
    System.debug('------------------------'+mList);
}

 

 

Best Answer chosen by Admin (Salesforce Developers) 
sandeep@Salesforcesandeep@Salesforce

Here to keep binded record with radio button you should use Apex:selectRadio tag in which you can bind id of record in this.value. Please try it and let me know in case of needing more help

All Answers

sandeep@Salesforcesandeep@Salesforce

Here to keep binded record with radio button you should use Apex:selectRadio tag in which you can bind id of record in this.value. Please try it and let me know in case of needing more help

This was selected as the best answer
sandeep@Salesforcesandeep@Salesforce

Thanks for makring my answer Can you please also give me kudos clicking on Star icon in left hand side.

Sapana WSapana W
Hi Mike/Sandeep,

Can either of you put the visualforce code snippet along the apex:selectRadio. so I could not get it working.

-Thanks