5 Replies Latest reply on May 20, 2009 11:01 AM by Pieter Martin

    Calendar blocked after Ajax Request

    Bernd Winterstein Newbie

      Hi
      I have two columns in a datatable. One has a custom filter with an input text, the other has a custom filter with a calendar.

      When I enter a character in the textfield, the onkeyup fires an ajax request and the table is rerendered. This is the moment when the calendar stops working. After clicking an a sort icon the calendar works again.

      RF 3.3 and the Problem is in FF3 and IE6

      <rich:column id="documentNo"
      sortBy="#{item.bo.belegnr}"
      selfSorted="true"
      filterMethod="#{invoice.filterByDocumentNo}">
      <f:facet name="header">
      <a4j:outputPanel id="docNoDiv" layout="block" style="float:left;">

      <h:outputText value="#{I18nBean['1.183']}" />
      <!-- filter ui wrapped in div -->
      <a4j:outputPanel id="docNoFilterDiv" layout="block" onclick="Event.stop(event);">
      <h:inputText id="filterDocumentNo"
      value="#{invoice.filterDocumentNo}"
      style="width:50px;">
      <a4j:support event="onkeyup"
      reRender="invoice_table_panel,invoice_table_pager"
      ignoreDupResponses="true"
      requestDelay="700"
      oncomplete="setCaretToEnd(event);" />
      </h:inputText>
      </a4j:outputPanel>
      </a4j:outputPanel>
      </f:facet>
      <a4j:htmlCommandLink value="#{item.bo.belegnr}"
      styleClass="ml-link"
      rendered="#{item.bo.editable}"
      action="GoToInvoiceDetails">
      <a4j:actionparam name="invoiceId"
      assignTo="#{invoiceDetails.invoiceId}"
      value="#{item.bo.belegkopfId}" />
      </a4j:htmlCommandLink>
      <a4j:commandLink value="#{item.bo.belegnr}"
      styleClass="ml-link"
      target="_blank"
      rendered="#{not item.bo.editable}"
      ajaxSingle="true"
      actionListener="#{invoice.prepareReportLink}"
      data="#{invoice.reportUrl}" oncomplete="openReport(data)">
      <a4j:actionparam name="messageType"
      value="#{item.bo.class.name}" />
      <a4j:actionparam name="messageId"
      value="#{item.bo.messageId}" />
      </a4j:commandLink>
      </rich:column>

        • 1. Re: Calendar blocked after Ajax Request
          Bernd Winterstein Newbie

          And the other column:

          <rich:column filterMethod="#{invoice.filterByDocumentDate}" sortBy="#{item.bo.belegdatum}">
          <f:facet name="header">
          <a4j:outputPanel id="docDateDiv" layout="block" style="float:left;">
          <!-- column header and break -->
          <h:outputText value="#{I18nBean['1.202']}" />
          <!-- filter ui wrapped in div -->
          <a4j:outputPanel id="docDateFilterDiv" layout="block" onclick="Event.stop(event);">
          <rich:calendar id="docDate"
          value="#{invoice.filterDocumentDate}"
          locale="#{invoice.locale}"
          datePattern="#{invoice.datePattern}"
          timeZone="#{invoice.timezone}"
          reRender="invoice_table_panel,invoice_table_pager"
          ajaxSingle="true"
          onchanged="this.form.submit()"
          inputStyle="width:70px;" />
          </a4j:outputPanel>
          </a4j:outputPanel>
          </f:facet>
          <h:outputText value="#{item.bo.belegdatum}">
          <f:convertDateTime locale="#{invoice.locale}" timeZone="#{invoice.timezone}"/>
          </h:outputText>
          </rich:column>

          • 3. Re: Calendar blocked after Ajax Request
            Pieter Martin Novice

            Halo,

            This is still happening for me in 3.3.1

             <rich:column filterExpression="#{accountantFilter.startedFilter eq null or accountantFilter.startedFilter.before(objectVar.started)}">
             <f:facet name="header" >
             <s:fragment>
             <h:outputText value="#{messages['started']}" />
             <rich:calendar value="#{accountantFilter.startedFilter}">
             <a:support ajaxSingle="true" event="onchanged" reRender="accountantListHtmlDataTableJsfId" />
             </rich:calendar>
             </s:fragment>
             </f:facet>
             <s:decorate id="objectVar_started_decorateHtmlCalendar" template="/layout/editInsideTable.xhtml" rendered="#{objectVar.isGroupOwnershipValid(user)}">
             <rich:calendar value="#{objectVar.started}">
             <f:facet name="a4jsupport" >
             <a:support ajaxSingle="true" event="onblur" reRender="objectVar_started_decorateHtmlCalendar" />
             </f:facet>
             </rich:calendar>
             </s:decorate>
             </rich:column>
            


            Hope you can help.

            Thanks
            Pieter

            • 4. Re: Calendar blocked after Ajax Request
              Ilya Shaikovsky Master

               

              <rich:dataTable value="#{capitalsBean.capitals}" var="cap" id="table" rows="20">
              ....
               <rich:column>
               <f:facet name="header">
               <s:decorate>
               <rich:calendar >
               <a4j:support event="onchanged"/>
               </rich:calendar>
               </s:decorate>
               </f:facet>
               <s:decorate>
               <rich:calendar >
               <a4j:support event="onchanged"/>
               </rich:calendar>
               </s:decorate>
               </rich:column>
               </rich:dataTable>
              

              this rechecked and works for me fine.. please try to clear the caches carefully.

              • 5. Re: Calendar blocked after Ajax Request
                Pieter Martin Novice

                Sorry, my bad, copied new jars into wrong workspace.

                Works great,
                Thanks
                Pieter