radio button
Example 1: radio buttons on VF page are used to set checkbox field type in the sObject
- <apex:page controller="testRadioController">
- <apex:form >
- <apex:selectRadio value="{!chosenOption}" >
- <apex:selectOptions value="{!items}"/>
- </apex:selectRadio>
- <apex:commandButton value="Commit" action="{!doSave}"/>
- </apex:form>
- </apex:page>
- public class testRadioController {
- public PageReference doSave() {
- return null;
- }
- public List<SelectOption> getItems() {
- List<SelectOption> options = new List<SelectOption>();
- options.add(new SelectOption('True','True'));
- options.add(new SelectOption('False','False'));
- return options;
- }
- public String chosenOption {get;set;}
- public testRadioController (){}
- }
Comments
Post a Comment