With HTML forms, a lack of data entered is frequently submitted as:
form_field_name=
which means that it doesn't differentiate between no input and a string with no length. With select + option elements, we have the same issue where when an option has selected=selected, then the select is submitted as it's name = the selected option's value. If that option happens to have a value of a string with no length, then it's indistinguishable from no selection happening. As such, a string with no length is effectively a reserved sentinel value for no selection, and it's not proper application usage to take that value and re-use it for something else. In this case, the application is using it to indicate a selection of an option which it internally deems as a non-user-choice. We need to take care to avoid confusing non-selection and non-user-choice.
To fix this, we need to make use of another sentinel value to indicate this non-user-choice. Anything will do, and I have tested that a space works fine. I changed the selectItem thusly:
<f:selectItem itemValue=" " itemLabel="-" />
And also, we need to change what the bean property is initialised to, or else we'll still get a single errant ValueChangeEvent.
private String a = " ";
Attached Test case that shows issue.
Steps: