I am setting up a form using JSF (I\'m pretty new at this) and I am getting a Validation Error: Value is not valid
message on one of the fields. This field is
Validation Error: Value is not valid
In case of
, you will get this when error whenever the selected item does not match any of the items available in the list. I.e. selectedItem.equals(selectItem)
has never returned true
for any of the items.
Since it's apparently a custom object (the Status
class), did you implement its Object#equals() (and #hashCode()) properly? You can if necessary let the IDE (Eclipse/Netbeans) autogenerate them.
Update: after having a closer look at your code, it turns out that you're actually submitting #{s.id}
instead of #{s}
(the whole Status
object). Fix the itemValue
accordingly and it should work (if equals()
is still doing its job properly).