Validation Error: Value is not valid

后端 未结 3 818
轮回少年
轮回少年 2020-11-21 04:22

I have a problem with a p:selectOneMenu, no matter what I do I cannot get JSF to call the setter on the JPA entity. JSF validation fails with this message:

3条回答
  •  执念已碎
    2020-11-21 05:00

    In my case I forgot to implement a correct get/set methods. It happened because I have changed a lot of attributes along the development.

    Without a proper get method, JSF can´t recover your selected item, and happens what BalusC said at item 1 of his answer:

    1 . The selected item is missing in the list of available items. This can happen if the list of available items is served by a request scoped bean which is not properly reinitialized on subsequent request, or is incorrectly doing the business job inside a getter method which causes it to return a different list in some way.

提交回复
热议问题