How to select one Radio button by default.

This is the code for Radio buttons,

When i run my application, "Button1" should be selected automatically.

<h:selectOneRadio required="true" >

<f:selectItem itemValue="Button1" itemLabel="Button1"/>

<f:selectItem itemValue="Button2" itemLabel="Button2" /> </h:selectOneRadio>

so, how to select one Radio button defaultly.

Thanks,

Vinutha.

[411 byte] By [vinuthamla] at [2007-11-26 19:16:22]
# 1

<h:selectOneRadio required="true" value="">

-^^^^^^^^^^

You can write for example "Button2" then the second entry is selected by default.

Perhaps a better was is to take the value from a backing-bean #{backingbean.radioValue} where you can set the default value to the radioValue-property.

UlrichCecha at 2007-7-9 21:29:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...