Hello - I'm storing a flag/boolean property of a bean as an int (0 or 1) in my db, and want to render it using the <h:selectBooleanCheckbox component. When I try to load the page, of course, I get an error indicating that a boolean is expected, but I've got the property bound to the bean property of type int. Is there an easy way to provide automatic back-and-forth conversion for this property on both rendering and submitting, or will I need to write a custom converter? Thanks for any help.
- Joe
Daniel Rhoades
Ranch Hand
Joined: Jun 30, 2004
Posts: 186
posted
0
Personally I'd deal with the property as a boolean in the bean and depending on your persistence mechanism do the conversion from Java boolean to SQL TINYINT when persisting/updating in your DAO/persistence classes.
Drinking more tea is the key...
subject: using "h:selectBooleanCheckbox" component