Primefaces p:calendar with p:ajax value not updated (one step delay)

后端 未结 2 1898
予麋鹿
予麋鹿 2021-01-16 13:00

I want to call a bean after a date is selected in a p:calendar. In my setup I have a @Named @ViewScoped Bean, the class ObWithDate is

2条回答
  •  天涯浪人
    2021-01-16 13:21

    This is most likely a lifecycle issue. The setter for your field is called before your listener executes. You should not use the listener to set your value.

    The el expression on your listener is evaluated at render response phase of the previous request thus it holds the cum value "one step behind".

    You should update your custom object from the setter of the calendar's date value.

提交回复
热议问题