0

I am using <p:selectOneRadio> mapped with Boolean (Wrapper class) property, so while display since the property is null, radio button is seen unselected (which is correct), but on click of save button, by default false is set in property even on not selecting any option (Yes/No). And after save, 'No' is appeared as being selected.

Below is the code (Primefaces 4):

<p:selectOneRadio value="#{myBean.hasMyBooleanProperty}">
                <f:selectItem itemLabel="Yes" itemValue="#{true}" />
                <f:selectItem itemLabel="No" itemValue="#{false}" />
</p:selectOneRadio>

Kindly let me know.

Best regards,

Soheb Shaikh

user3819259
  • 95
  • 1
  • 9

1 Answers1

0

The question has been answered here: (See BalusC's answer)

jsf: integer property binded to a inputtext in UI is set to zero on submit

Adding -Dorg.apache.el.parser.COERCE_TO_ZERO=false to your system properties will fix it. Make sure that the boolean property is of type Boolean and not the primitive.

Community
  • 1
  • 1
ChristopherS
  • 853
  • 4
  • 16