Radio Button in Salesforce


To create Radio button using apex, use <apex:selectRadio>


Example:


Visualforce page:


<apex:selectRadio value=”{!searchCategory}” >
    <apex:selectOption itemValue=”Member” itemlabel=”Member”/>
    <apex:selectOption itemValue=”Blog” itemlabel=”Blog”/>
    <apex:selectOption itemValue=”Photo” itemlabel=”Photo”/>
</apex:selectRadio>




Apex:


public String searchCategory;


public String getsearchCategory()
{
return searchCategory;
}

public void setsearchCategory(String searchCategory)
{
this.searchCategory = searchCategory;
}

Leave a Reply