• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

get value of HtmlSelectOneRadio

 
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This seems to work:

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic