rich:日历不触发f:ajax

时间:2013-10-23 11:38:51

标签: ajax jsf richfaces

我是jsf的新手,我正在使用richfaces编写我的第一个应用程序。我在使用ajax标签时遇到问题,我用它来更新服务器上的富联:日历组件的关联托管bean属性。这是代码:

<rich:panel header="Computing Options">
            <h4>Time Interval</h4>
            <h:panelGrid columns="4" width="100%">
                <h:outputText value="From" />
                <rich:calendar id="intervalFrom" value="#{scenarioEditor.intervalFrom}" popup="true" showApplyButton="true" datePattern="yyy-MM-ddTHH:mm">
                    <a4j:ajax execute="@this" event="change" render="outFrom" />
                </rich:calendar>
                <h:outputText value="To" />
                <rich:calendar id="intervalTo" value="#{scenarioEditor.intervalTo}" popup="true" showApplyButton="true" datePattern="yyy-MM-ddTHH:mm">
                    <a4j:ajax execute="@this" event="change" render="outTo" />
                </rich:calendar>
                <h:outputText id="outFrom" value="From: #{scenarioEditor.intervalFrom}" />
                <h:outputText id="outTo" value="To: #{scenarioEditor.intervalTo}" />
            </h:panelGrid>
            <h4>Algorithms</h4>
            <h:panelGrid columns="2"> 
                <h:selectBooleanCheckbox value="#{scenarioEditor.visibilityClashes}" id="clash" >
                    <f:ajax execute="@this"/>
                </h:selectBooleanCheckbox>
                <h:outputLabel value="Visibility Clashes Evaluator" for="clash" style="width:170px" />
                <h:selectBooleanCheckbox value="#{scenarioEditor.xBandInterference}" id="xband" >
                    <f:ajax execute="@this"/>
                </h:selectBooleanCheckbox>
                <h:outputLabel value="X-Band Interferences Evaluator" for="xband" style="width:170px"/>
            </h:panelGrid>
        </rich:panel>

复选框工作正常,但日历没有。为什么?我试过f:ajax和a4j:没有运气的ajax。

为了更好地说明,我希望在用户完成向日历中输入值之后,会发出一个调用相关属性的setter方法的ajax请求。而且,对于日历不会发生,而对于复选框,它会发生。

1 个答案:

答案 0 :(得分:0)

由于datePattern="yyy-MM-ddTHH:mm"中的 T 不是valid date formatting pattern,因此ajax事件失败。如果您在字段中添加<rich:messages/>组件,则会看到每个ajax请求都发生转换错误。删除T,你会没事的