VF page Code:
<apex:form >
<apex:actionfunction name="refreshvalue" action="{!classMethod}" rerender="pklist"/>
<apex:selectRadio value="{!Val}" onchange="refreshvalue()">
<apex:selectOptions value="{!radioValues}"/>
</apex:selectRadio>
<apex:selectList size="1" id="pklist">
<apex:selectOptions value="{!PicklistValues}"/>
</apex:selectList>
</apex:form>
Controller Class
public class DepPclass {
public List<SelectOption> PicklistValues { get; set; }
public List<SelectOption> radioValues { get; set; }
public String Val { get; set; }
public depPclass(){
PicklistValues = new List<SelectOption>();
radioValues = new List<SelectOption>();
radioValues.add(new SelectOption('Letters','Letters'));
radioValues.add(new SelectOption('Number','Number'));
}
public PageReference classMethod() {
if(val == 'Letters'){
PicklistValues.clear();
PicklistValues.add(new SelectOption('a','A'));
PicklistValues.add(new SelectOption('b','B'));
PicklistValues.add(new SelectOption('c','C'));
}else{
PicklistValues.clear();
PicklistValues.add(new SelectOption('1','1'));
PicklistValues.add(new SelectOption('2','2'));
PicklistValues.add(new SelectOption('3','3'));
}
return null;
}
}