JSF sets the default value. Radio Button h: selectOneRadio

<h:selectOneRadio id="radio1" value="#{testBean.value}">
    <f:selectItem itemValue="High School" itemLabel="High School" />
    <f:selectItem itemValue="Bachelor's" itemLabel="Bachelor's"/>
    <f:selectItem itemValue="Master's" itemLabel="Master's"/>
    <f:selectItem itemValue="Doctorate" itemLabel="Doctorate" />
</h:selectOneRadio>
+3
source share
1 answer

Install a valuebean in your support with the desired default value. For example, if you want the default "High School":

value = "High School";

This can be done in the constructor or in the @PostConstruct method depending on the scope of your bean support.

+9
source

All Articles