tags:

views:

222

answers:

1

hi are there any attributes to pre select some radio button in tag on page lodads

below is my code i want the Now radio button to be selected when page loads ,

any help pls ?

<h:selectOneRadio id="Radios"
    value="#{pc_ClosureDecision.closureDetails.approvalDateSelected}"
    layout="lineDirection" onclick="check_Date()">
     <f:selectItem itemValue="now" itemLabel="Now" />
     <f:selectItem itemValue="later" itemLabel="Resolve Later" />
</h:selectOneRadio></td>
+4  A: 

Initialize #{pc_ClosureDecision.closureDetails.approvalDateSelected} with a value of "now" (in the Java code, or by injection in your faces-config.xml).

McDowell
thanks McDowell it is working
Sunny Mate
+1,Not exactly the same problem I was having, but by reading your answer I realized that the value attribute is not expecting a SelectItem from my backing bean, so I changed it to be the specific item value, now it's working. Thanks.
Abel Morelos