Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    filter-on-keypress not triggered with DATE list grid field

    GWT 2.5.1 and v8.3p_2013-03-22/LGPL (tested with 2013-04-11, too)

    Setup
    • ListGrid with three columns. Two columns have an unspecified type i.e. they use text. One column is ListGridFieldType.DATE.
    • showFilterEditor and filterOnKeypress are both enabled.
    • (remote) RestDataSource


    Problem
    filterOnKeypress works if I either
    • only filter by text columns
    • filter by text, then date and then modify the text again

    If I first enter a date range and later a value for a text column no request is ever submitted against the server. Likewise, if I filter by text then by date (without modifying text afterwards) no request is submitted after the date range was entered.
    Since this seems to occur only when using remote data sources I cannot provide a simple self-contained test case. The test case of one of my previous posts which uses a local data source does not show this behavior.

    Note
    If I change the date column to type TEXT this all works fine. I assume this is because then Smart GWT does not use the AdvancedCriteria API.
    Last edited by fhisg; 11 Apr 2013, 04:55.

    #2
    This is by design. The date control will not try to filter during partial entry of dates because the date value is frequently invalid while typing, or the value is totally unrelated between different keypresses because the different numbers are alternately treated as month or year values as more digits and separators are typed.

    Comment


      #3
      Sorry, don't really understand your reply.

      We're using the DateRangeDialog that Smart GWT provides out-of-the-box for list grid field type DATE. Once OK is clicked in the dialog and it closes we expect the grid to issue a fetch request against its data source.

      Comment


        #4
        If you aren't expecting filtering to happen on every keypress in the date field, that's good. However you still seem to be expecting that filtering will happen every time criteria are changed, which also won't happen - see docs for ListGrid.fetchData() and the Adaptive Filtering sample.

        Comment


          #5
          Originally posted by Isomorphic View Post
          However you still seem to be expecting that filtering will happen every time criteria are changed
          Hhhmm, isn't this what filterOnKeypress=true is supposed to ensure? After all, filtering does happen for TEXT fields with every character that is added/removed (i.e. criterion changed). A misconception on my side?

          Comment


            #6
            No, filter on keypress means that filtering happens on every keypress. But there is both client and server-side filtering, and to understand this, you should review the docs and samples previously recommended.

            Comment


              #7
              Originally posted by Isomorphic View Post
              However you still seem to be expecting that filtering will happen every time criteria are changed, which also won't happen - see docs for ListGrid.fetchData() and the Adaptive Filtering sample.
              I knew about adaptive filtering (which is really cool btw) but just to make sure I'm not sittin' on outdated or inconclusive info I looked at the sample and the underlying code. I also re-read upon ListGrid#fetchData(). From all that I conclude that filtering does happen whenever the criteria changes BUT filtering doesn't necessarily trigger a DS fetch. This is the behavior the sample exhibits.
              Also, if I modify my own DateRange sample (file-based DS) to include a lot more data I see that filtering is still applied when the DateRangeDialog is closed clicking 'OK'. I also see that client-side filtering works nicely.

              I understand that my initial post was misleading because I used the phrase "no request is ever submitted against the server". While this is true I should have mentioned that for changes to the DATE criteria no client-side filtering is applied either. I have no idea why this is and since this only shows with a REST DS I cannot post a test case.
              How can I track this further?

              P.S. I believe there's a bug in the source code doc of the sample. The closing '}' in

              Code:
              if(request.getOperationType() == DSOperationType.FETCH) {}
              should be placed after '}.schedule(500);'.

              Comment


                #8
                If you think it might be a framework bug, the easiest way to put together a test case we can run is to swap in a clientOnly DataSource. You might just start from one of the sample DataSources and add settings equivalent to your actual grid.

                Comment

                Working...
                X