Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JSF and the fly likes My checkbox will not stay checked Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "My checkbox will not stay checked" Watch "My checkbox will not stay checked" New topic
Author

My checkbox will not stay checked

Davie Lin
Ranch Hand

Joined: Aug 05, 2007
Posts: 294

Hi guys, I have a checkbox like



The above code is enclosed in richface modal panel. However, only when I open the window the first time, the check box is pre-checked and on subsequent window opening, the checkbox is no longer checked. I have try to replace "true" with "#(variableFromBean}" and set that variableFromBean everytime someone click a button to open that modal panel. That just simply don't even check the box at all. I am using JSF 1.1, very frustrated with the stupid crap this framework keep throwing me. Please, if you know something that can help me solve this issue, greatly appreciated.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14456
    
    7

Blanking out of values usually comes from defining a property's scope too narrowly. Generally that means giving "request" scope, since request scope objects get destroyed and re-created between postbacks.

Interesting that the hard-coded constant "true" would blank out, but not impossible. You're supposed to use a read/write property when using input controls.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: My checkbox will not stay checked
 
Similar Threads
CheckBox Status
Check box opens new window and checks a new box
window.showModalWindow problem
Unable to clear error message from the dojo dialog
check box probelm