Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

h:selectOneRadio - how to set default value?

843844Nov 1 2007 — edited Nov 1 2007
Hi,

I got following code, when my bean property (clientList.client.status) has null value I expected option 'All' to be selected; but it does not. It shows all options unselected.

Can this be done?

<h:outputLabel for="clientStatus">Member status</h:outputLabel>
<h:selectOneRadio id="clientStatus" value="#{clientList.client.status}" styleClass="radio">
<f:selectItem itemValue="" itemLabel="All"/>
<f:selectItem itemValue="active" itemLabel="Active"/>
<f:selectItem itemValue="locked" itemLabel="Locked"/>
<f:selectItem itemValue="suspended" itemLabel="Suspended"/>
</h:selectOneRadio>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 29 2007
Added on Nov 1 2007
2 comments
130 views