1 Reply Latest reply on Sep 24, 2011 5:31 PM by ilya_shaikovsky

    Richfaces Calendar as filter in rich:datatable

    smileface

      Hi,

      i have problem with Richfaces callendar filtering in datatable. My code is:

       

      <rich:dataTable id="dataTableModul2" value="#{dataTableModul2.list}" width="300px" var="row" rows="10">    

              .....

                <rich:column sortBy="#{row.confirmDate}" filterMethod="#{filterDateBean.filterDateMoreActual}">

                          <f:facet name="header">

                              <h:panelGroup>

                                  <h:outputText value="#{msg.confirmDate}"/><br/>

                                  <rich:calendar value="#{filterDateBean.filterValue}" id="inputTestFilter" datePattern="dd.MM.yyyy"  locale="cs_CZ" onclick="Event.stop(event);">

                                      <a4j:support event="onchanged" reRender="dataTableModul2"

                                          ignoreDupResponses="true" requestDelay="700"/>

                                  </rich:calendar>

                              </h:panelGroup>

                          </f:facet>

                          <h:outputText value="#{row.confirmDate}">

                              <f:convertDateTime pattern="dd.MM.yyyy HH:mm" />

                          </h:outputText>

                      </rich:column>

             ....           

                    </rich:dataTable>

       

      Filter works fine without sorting, but when I add SortBy and click for the callendar it opens (thanks onclick="Event.stop(event);"). But when I want to

      change year or do any other action callendar closes and datatable is sorted. It seems like some incompatibility between the sorting and filtering. Is any solution for this?

        • 1. Re: Richfaces Calendar as filter in rich:datatable
          ilya_shaikovsky

          It seems like some incompatibility between thesorting and filtering.

          No, not filtering with sorting but calendar issue.

          Just click event bubbles because  seems onclick="Event.stop(event);") is handled erroneous in 3.3.x.. I didn't checked by believe that it just doesn't executed correctly  when click is in popup. If so need to do one of the things

          • patch the component to make onclick work properly for all the component including popup.o
          • create workaround with external sorting definition. If that case you will have full control on it. (E.g. will be able to check onsubmit for your sort support if the calendar was an original event source)
          • bind your own handlers to calendar elements click using jQuery instead of built-in attributes.