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

后端 未结 2 1895
予麋鹿
予麋鹿 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.

    0 讨论(0)
  • 2021-01-16 13:25

    I ran into this issue today morning. Found that primefaces have removed the DateSelectEvent from Primefaces 3.5 . Hence had to remove the ajax event call from my calendar object. Instead retrieving the value using get..(). Please find the discussion for the same in this link below. http://forum.primefaces.org/viewtopic.php?f=3&t=27590

    0 讨论(0)
提交回复
热议问题