This content has been marked as final.
Show 2 replies
-
1. Re: selectOneRadio with no items selected
panky_p Jun 23, 2009 3:47 AM (in response to oneworld95)If your payrollEmployee is boolean change it to Boolean.
your "#{newemployee.payrollEmployee}" should be null and not either true or false this way neither yes or no will be selected when the page loads.
Use layout="lineDirection" on h:selectOneRadio to go horizontally -
2. Re: selectOneRadio with no items selected
oneworld95 Jun 23, 2009 8:14 AM (in response to oneworld95)Thanks, panky_p. That fixed all the issues! It makes sense now: In Java, wrapper datatype objects are better instead of primitive datatypes because wrapper types can be null while primitives cannot: http://www.freshsources.com/Mar99.html
And boolean is a primitive type, whereas Boolean is the wrapper object. I made the following change in the action class for the form:private Boolean payrollEmployee = null; //don't use "boolean"
The layout="lineDirection" fixed the other problem. In addition, the XHTML used CSS form layout, and the labels auto generated for the radio buttons were inheriting some unnecessary styling, which was throwing them all over the place.
Thanks again, panky_p :D