File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Java
»
JSF
Author
How to set the defaule selection for selectOneRadio
deepan thiagu
Greenhorn
Joined: May 15, 2007
Posts: 18
posted
Jul 12, 2007 04:22:00
0
Hai every one
i dont know how to set defaule selection, for selectOneRadio. please any one give me the right solution
i give my sample code here
<h:selectOneRadio id="gender" layout="pageDirection" value="#{user.gender}" > <f:selectItem itemValue="Male" itemLabel="Male"/> <f:selectItem itemValue="Female" itemLabel="Female"/> </h:selectOneRadio>
here i want to set male as a default selected one
Klaus Claszen
Greenhorn
Joined: Jun 20, 2007
Posts: 16
posted
Jul 12, 2007 05:32:00
0
Hi,
try to define the default value in your managed-bean configuration (faces-config.xml)
<managed-bean> <managed-bean-name>user</managed-bean-name> <managed-bean-class>FooBar</managed-bean-class> <managed-bean-scope>FooBar</managed-bean-scope> <managed-property> <property-name>gender</property-name> <value>Male</value> </managed-property> </managed-bean>
Regards
Klaus
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: How to set the defaule selection for selectOneRadio
Similar Threads
Nest the selectOneRadio Under the selectManyCheckbox
Using boolean value in SelectOneRadio
JSF2 Populate SelectOneRadio with Enum values
selectOneRadio problem
JSF SelectOneRadio and inputText
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter