[英]action or actionListener not fired when using pattern “hh:mm a” in Prime faces calendar p:calendar
I need to use prime faces calendar to fill time ONLY as the following : 我需要使用黄金的面孔日历填写一次只为以下几点:
<h:body>
<h:form>
<p:calendar pattern="hh:mm a" value="#{bean.startTime}"/>
<p:commandButton value="Save" actionListener="#{bean.saveAppointment}" />
</h:form>
</h:body>
But the saveAppointment
method not fired at all. 但是saveAppointment
方法根本没有被触发。 and without any Exception. 没有任何例外。
After tracing the issue I have concluded that the issue from the date conversion that primefaces uses under the cover.That is because when I omit a
from the pattern ie(the pattern become pattern="hh:mm"
). 在跟踪问题之后,我得出结论,问题来自于primefaces在封面下使用的日期转换。那是因为当我从模式中省略a
时(即模式变为pattern="hh:mm"
)。 Then the action fired normally without any issue. 然后行动正常解决没有任何问题。
Note Primefaces version is 6 注意 Primefaces版本是6
我通过使用pattern="HH:mm"
找到了一个解决方法,大写H将使小时数为0-23。
检查选项:timeOnly =“true”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.