• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to make one of the Radio button default selected

 
Thushar ashok
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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
 
Ketan Jambhekar
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Set the value of variable styleType as 0,1,or 2 whichever you want as default.

Thanks
Ketan.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic