【问题标题】:Primefaces calendar validationPrimefaces 日历验证
【发布时间】:2013-03-12 04:28:27
【问题描述】:

我正在尝试使用弹出按钮将日历验证为输入文本 输入文本已正确验证。但是,无法验证从弹出按钮中选择的日期 我的 xhtml 代码是:

<p:calendar value="#{indexBean.searchCriteria.date}" 
            id="date" showOn="button"
            mindate="#{indexBean.searchCriteria.mindate}" maxdate="#{indexBean.searchCriteria.maxdate}"
            label="Date" converterMessage="The Date must be of the form DD/MM/YYYY and be a valid date"
            pattern="dd/MM/yyyy" validator="#{indexBean.validateDate}" widgetVar="dateCalendar"
            timeOnly="false">
    <f:convertDateTime pattern="dd/MM/yyyy" />
    <p:ajax update=":messages" event="change" />
</p:calendar>

我应该怎么做才能在弹出按钮上应用验证???

【问题讨论】:

标签: jsf primefaces


【解决方案1】:

使用 ajax,您应该能够键入日历的 dateSelect 事件,并执行标准的、ajax 驱动的验证。根据文档,弹出模式还可以在blurkeyup 上触发ajax 事件。您指定的change 仅适用于日历的输入文本位

【讨论】:

  • 感谢 kolossus 我决定改用 jQuery datePicker 干杯
猜你喜欢
  • 2013-11-04
  • 2013-02-22
  • 2011-12-20
  • 2019-06-09
  • 2010-12-11
  • 1970-01-01
  • 2020-07-19
  • 2012-09-27
  • 1970-01-01
相关资源
最近更新 更多