-1

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);
}
2

http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_selectRadio.htm

Use select radio component of vusualforce page to achieve your requirement than html tags.

Always prefer vusualforce tags as data binding is easier.Refer the above doc dig deeper

  • can you help me with my code...i want to use html select radio..?? – miku May 6 '13 at 18:17
  • So you want to show the selected value to user through that wrapper as read only or user can edit and change ? – Mohith Shrivastava May 6 '13 at 18:39
2

Unfortunately binding controller variables to native HTML input tags won't work. You need to use an apex:input**** tag for the controller to get your changes.

If you need to use standard HTML input tags you'll need to use apex remoting which provides a method for using javascript to call controller methods. Then you'll need to wire up some javascript to a button that when calls grabs the input tag value and then passes it to the apex remoting method.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.