[Solved] Wrong selected option for selectOneMenu with POJOs and Converter


Your mistake is that you forgot to implement/autogenerate equals() (and hashCode()) method conform the contract. This is beyond control of JSF. Pointing the accusing finger to JSF isn’t making any sense.

It’s handy to have a base entity where all your entities extend from so that you don’t need to repeat the task over all entities (even though the average IDE/tool can easily autogenerate them). You can find an elaborate example in 2nd “See also” link.

See also:

  • Validation Error: Value is not valid
  • Implement converters for entities with Java Generics

6

solved Wrong selected option for selectOneMenu with POJOs and Converter