wood burning stoves 2.0*
The moose likes JSF and the fly likes Issue with Changing the h:selectoneRadio button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSF
Bookmark "Issue with Changing the h:selectoneRadio button" Watch "Issue with Changing the h:selectoneRadio button" New topic
Author

Issue with Changing the h:selectoneRadio button

Varshini Priya
Ranch Hand

Joined: Feb 17, 2008
Posts: 93

I have a h:selectoneradio which contains three option, on click of each of the radio button, a corresponding panel group needs to be rendered. Below is my xhtml code,



On click on the Edit button, the radio button components needs to be enabled. Below is the code for listener




Once I click on the edit button, the components are enabled. But when I try to select the radio option, the control goes back to the ispermissiontoEdit method, and sets permissionToEdit to true. Im not sure why the control goes to the iSpermissionToEdit method on click of the radio button. Can you please provide some pointers to help me resolve the issue. Thanks in Advance.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16095
    
  21

Actually, it would have been easier to follow if you could have simplified your example.

The parameter in your ajaxlistener method is optional - I recommend not including it unless you use it.

Most commonly, unexpected variable values come from attempting to use request scope on JSF backing beans. The request scope isn't completely useless in JSF, but it's so close to useless that it might as well be. Try View scope instead, if that's the issue.


Customer surveys are for companies who didn't pay proper attention to begin with.
Varshini Priya
Ranch Hand

Joined: Feb 17, 2008
Posts: 93

Thanks a lot Tim for the clarification. I have changed the scope of the Managed to viewScope. But, when I click on the Edit button, Im getting the below serializable exception and the listener corresponding to the editbutton is not getting rendered.




Im not sure what is causing the above exceptions. Can you please provide some pointers to fix the issue. Thanks in Advance
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16095
    
  21

Can you simplify your view definition so that it all fits on one screen? I cannot see the forest for all the trees.

That "cannot nest CDATA" is ominous, though. Are you by any chance accessing the FacesContext in your code somewhere? Or maybe don't have serialization set up properly on one of your model objects? View, session, and application scope objects must be serializable.
Varshini Priya
Ranch Hand

Joined: Feb 17, 2008
Posts: 93

Thanks a lot Tim for the response. Im not using FacesContext in my code. Also could you please elaborate on how to simplify the view Definition. I have set up Serialization in all the classes. But not sure why, Im still getting the below exception. Also by Model objects, you mean the ManagedBean in which the DataModel has been implemented right ? Please Clarify

 
GeeCON Prague 2014
 
subject: Issue with Changing the h:selectoneRadio button