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
Vivek KidambiVivek Kidambi 

apex:dynamicComponent - Setting value to selectRadio

I have created a dynamicComponent which constructs a selectRadio with options. everything is good so far, but i am unable to set a value on load. For eg, I already have a preselected value which i need to dynamically show as selected for one of the option.

 When i debug the sltRadio.value, it shows up correctly, however the value is not selected on page. Appreciate any help in this regard.
public String selectedValue {get;set;}

Component.Apex.selectRadio sltRadio = new Component.Apex.selectRadio();	
	for(String option : lstString){
	   Component.Apex.selectOption so = new Component.Apex.selectOption();
	   so.itemValue = option;
	   so.itemLabel = option;
	   sltRadio.childComponents.add(so);
    }
sltRadio.value = selectedValue;
myTab.childComponents.add(sltRadio);