Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Issue with Changing the h:selectoneRadio button

 
Varshini Priya
Ranch Hand
Posts: 95
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18009
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Varshini Priya
Ranch Hand
Posts: 95
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18009
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 95
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic