*
The moose likes JSF and the fly likes get value of HtmlSelectOneRadio Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "get value of HtmlSelectOneRadio" Watch "get value of HtmlSelectOneRadio" New topic
Author

get value of HtmlSelectOneRadio

James Ellis
Ranch Hand

Joined: Oct 14, 2004
Posts: 205
I have a strange situation where the components on a form are dynamically built and the form is submitted to an action method "create" on a Controller class. Basically the form looks like this:

HtmlPanelGrid
--HtmlOutputText
--HtmlPanelGrid
----HtmlSelectOneRadio
----HtmlInputText

(picture a table with 2 columns, the first is some text and the second contains a radio box and an input textbox)

Anyway, to do the validation on this page, in the action method I have code like this:



Unfortunately the htmlSelectOneRadio.getValue() call always returns null, regardless of whether or not the radio box is checked. How do I get the value of whether or not the radio box is checked? There is no isChecked method on that class...

PS - I can print out the id on that radio box and it is printing the correct ID, so I know that I at least have the correct component.
g madhava
Ranch Hand

Joined: Sep 14, 2001
Posts: 85
Since the full code of the managed bean and the corresponding JSP is not posted here,I think we can help you with debugging...

Please try setting up a phase listener and
see what's happening at each phase.

http://www.jsftutorials.net/faces-config/phaseTracker.html
James Ellis
Ranch Hand

Joined: Oct 14, 2004
Posts: 205
This seems to work:

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: get value of HtmlSelectOneRadio
 
Similar Threads
ValueChangeListener question
Create HtmlSelectOneRadio through backing bean
commons-fileupload
setAction Problem HtmlCommandButton
How to get Values out of dynamic created panel