Can a default value "Select One " be set to SelectOneMenu component after a validation error in the phase listener afterPhase() method?
Right now if the default value "Select One" is selected and form is submitted
<h:selectItem itemLabel="Select One" itemValue=""/>
The select one menu value is changed to previously valid value.
You need to make the item value non-empty (and non-null!) and set the noSelectionOption attribute to true.
<f:selectItem itemLabel="Select One" itemValue="none" noSelectionOption="true" />
(and fix the h:selectItem to be f:selectItem)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With