• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

How to create default value for radio button

 
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would like to check one of the radio button below as default value.. How do I do that in JSF. For example I owuld like to check/select Pass as default value. Thanks.
 
Saloon Keeper
Posts: 28709
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might like to change your display name to "Gopu Lilly".

However, in answer to your question, your problem lies in that you've defined a hardcoded display. In real life, you'd normally be setting the display from a backing bean and probably setting the backing bean from the display as well.

Like so:

The default value would be whichever value you'd initialized carBean.currentCar to. I've copied an example that uses the selectItems tag instead of individual selectItem's, but operation is identical.

Here's a good place for JSF tag usage examples:

http://www.exadel.com/tutorial/jsf/jsftags-guide.html
 
reply
    Bookmark Topic Watch Topic
  • New Topic