Java richfaces日历在数据不正确时不会触发操作

Java richfaces日历在数据不正确时不会触发操作,java,jsp,ejb,richfaces,Java,Jsp,Ejb,Richfaces,Java richfaces日历在数据不正确时不会触发操作: 我有这个日历: <rich:calendar id="olr_from" enableManualInput="true" isDayEnabled="isDayEnabled" dayStyleClass="getDisabledStyle" value="#{logPackageRequest.logPac

Java richfaces日历在数据不正确时不会触发操作:

我有这个日历:

<rich:calendar id="olr_from" enableManualInput="true"
                    isDayEnabled="isDayEnabled"
                    dayStyleClass="getDisabledStyle"
                    value="#{logPackageRequest.logPackageRequest.from}" datePattern="MM/dd/yyyy"
                    cellHeight="22px" inputStyle="width:180px" />

我有一个按钮:

            <a4j:commandButton id="Submit_button"
                value="#{msgs.submitButton}" styleClass="form_button"
                action="#{logPackageRequest.createLogPackageRequest}"
                reRender="clrForm,clearInactive_button"
                oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('createLogRequestView')}.hide();" />

我有一个问题:

当我按下按钮时,它被称为函数createLogPackageRequest。 但仅当日期格式为corect时(如2013年5月23日)。如果日期为2013年5月23日或2013年3月3日,则不再调用函数createLogPackageRequest。 为什么会有这种奇怪的行为?我怎样才能修好它

谢谢


Dorian

如果将
enableManualInput
属性值设置为
false
,然后每次从日历中选择日期,则不会出现此问题

您选择的日期格式为
MM/dd/yyyy
,那么为什么要输入与日期无关的字符呢

启用人工输入: 如果“真”,日历输入将是可编辑的,并且可以手动更改日期。如果此属性的“false”值使文本字段为“只读”,则只能从句柄更改该值。默认值为“false”

下面是一个例子:

 <rich:calendar id="olr_from" enableManualInput="false" 
          isDayEnabled="isDayEnabled"
          dayStyleClass="getDisabledStyle"
          value="#{logPackageRequest.logPackageRequest.from}" datePattern="MM/dd/yyyy"
          cellHeight="22px" inputStyle="width:180px" />