wood burning stoves*
The moose likes JSF and the fly likes How to bind a radio button value to a backing bean? 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 bind a radio button value to a backing bean?" Watch "How to bind a radio button value to a backing bean?" New topic
Author

How to bind a radio button value to a backing bean?

Dave Alvarado
Ranch Hand

Joined: Jul 02, 2008
Posts: 436
Hi,

I'm using MyFaces 1.1.6 on JBoss 5.1. I'm having trouble binding radio button values to the backing bean. Here's how I defined my backing bean in my faces-config.xml file ...



and here's how I define the radio buttons on the JSF page ...



but in my backing bean Java code, the setter is never called, evidenced by the fact that I never see the line in the log file and when I return to the page there is no value filled in ...



Any ideas how to bind a value to a radio button? - Dave
Srini Mutpur
Greenhorn

Joined: Mar 29, 2008
Posts: 24


The selectOneRadio element will be binded to the boolean datatype variables.
Change the specialNeeds datatype to boolean from String.

Srini

SCJP 1.5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to bind a radio button value to a backing bean?
 
Similar Threads
Display value of 'checked' radio button
h:selectOneRadio is rerendering panels inconsistently
Using boolean value in SelectOneRadio
selectOneRadio problem
How to make one of the Radio button default selected