Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to change check box state  RSS feed

 
Priya Joshi
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am very new to JSF.
I am facing one problem, I want to change the state of check box (want to uncheckd it).
Even though I am setting value to false but its not working, it is getting its state from the root view.
Below is the simle jsf code i am using and setting employer field's value in controller as false.
I debuge it the value is changing for the field but when it start executing JSF stuff and its value reset to true.

<html:selectBooleanCheckbox id="employerAndIncomeID" value="#{PersonBSO.employer}" />

I struggling with this. If anybody tell me how to change a JSF components value programatically will be great help for me.



Thanks and Regards,
Priya
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's not enough to actually indicate what the problem is. My guess is that your backing bean is in request scope and it's getting destroyed and recreated on each page request. It would need to be in session scope to avoid that.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!