File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes JSF1.2 SelectOneRadio problem: clicking on text does not update selection value Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "JSF1.2 SelectOneRadio problem: clicking on text does not update selection value" Watch "JSF1.2 SelectOneRadio problem: clicking on text does not update selection value" New topic
Author

JSF1.2 SelectOneRadio problem: clicking on text does not update selection value

Ling Lin
Greenhorn

Joined: Aug 08, 2012
Posts: 2
Hi everyone,

I'm having a problem with the selectOneRadio component in JSF1.2 where if user clicks on the label of the radio button, old selection value would still be passed as parameter in the ajax call. However if I click on the actual radio button of the option, everything works fine. New selection value will be passed.
====================================
[] Option 1 [] Option 2 [] Option 3

Steps:
Page starts with option 1 selected by default
Case 1:
If I click on the text "Option 2", JSFUtils.getParameters("paymentOption") will still return 0, which is the value of "Option 1"
If I then click on the text "Option 3", JSFUtils.getParameters("paymentOption") will return 1, which is the value of "Option 2"
Case 2:
If I click on the radio button "Option 2", JSFUtils.getParameters("paymentOption") will return 1, which is the correct value of "Option 2"
If I then click on the radio button "Option 3", JSFUtils.getParameters("paymentOption") will return 2, which is the correct value of "Option 3"
=====================================

Could someone please help me figure out how to fix this? Can I make clicking on label to have exact same behaviour as clicking on radio buttons?

Any help is greatly appreciated!

Code:





Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14486
    
    7

It would help if you could simplify your example. Since I don't get paid to do this, there's only a limited amount of time I'm willing to spend decoding questions, and I gave up trying to find the tree you're talking about in the forest of the sample XML.

The only thing I can say is that any JSF view that "passes parameters" or uses FacesContext to retrieve parameters is instantly suspicious to me, since JSF has much simpler mechanisms that can do the job in most cases.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSF1.2 SelectOneRadio problem: clicking on text does not update selection value
 
Similar Threads
selectOneRadio in several columns...
Apache Commons Validator: Working With Arrays
Component ID frm1_window viewid has already been found in the view
how to use selectOneRadio with javascript?
JSF SelectOneRadio and inputText