This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes How to make one of the Radio button default selected Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "How to make one of the Radio button default selected" Watch "How to make one of the Radio button default selected" New topic
Author

How to make one of the Radio button default selected

Thushar ashok
Greenhorn

Joined: Dec 31, 2008
Posts: 1
How to make one of the Radio button "default selected" in jsf when the page is rendered.

I am using h:selectOneRadio tag.

<h:selectOneRadio id="PageStyle" value="#{StyleBean.styleType}" >
<f:selectItem id="sa_id" itemValue="0" itemLabel="Style1" />
<f:selectItem id="wl_id" itemValue="1" itemLabel="Style2" />
<f:selectItem id="ot_id" itemValue="2" itemLabel="Style2" />
</h:selectOneRadio>
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

"thushar" please check your private messages for an important administrative matter. You can see them by clicking the My Private Messages link above.
And welcome to Javaranch


SCJP, SCWCD.
|Asking Good Questions|
Ketan Jambhekar
Ranch Hand

Joined: Mar 26, 2007
Posts: 37
Hi,
Set the value of variable styleType as 0,1,or 2 whichever you want as default.

Thanks
Ketan.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to make one of the Radio button default selected
 
Similar Threads
How to select one Radio button by default.
selectOneRadio problem
How to set the defaule selection for selectOneRadio
Adding space between Radio button and Label
How to create default value for radio button