• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Ling Lin
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 18408
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!