How to set default value of h:selectOneRadio button
Posted
by Nitin
on Stack Overflow
See other posts from Stack Overflow
or by Nitin
Published on 2010-03-22T09:54:32Z
Indexed on
2010/03/22
10:01 UTC
Read the original article
Hit count: 634
jsf
Hi All
I am unable to set the default value of h:selectOneRadio as i need radio button to be pre selected
<h:selectOneRadio id="myRadio" value="#{Externalbean.addressFlag}" >
<f:selectItem itemValue="1" itemLabel="Yes"/>
<f:selectItem itemValue="0" itemLabel="No"/>
</h:selectOneRadio>
and my backing bean is
private String addressFlag="0";
public String getAddressFlag() {
return addressFlag;
}
public void setAddressFlag(String addressFlag) {
this.addressFlag = addressFlag;
}
but no luck
© Stack Overflow or respective owner