Announcement

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

    ListGrid losing advanced/nested criteria on FilterEditor submit

    FF: 26
    GWT: 2.6
    SGWT: 5.0p 03/19/2015 10:13

    Nested criteria is being lost when using the FilterEditor with a ds field that has setMultiple(true).

    Used the code from:
    http://www.smartclient.com/smartgwt/...r_builder_grid
    With the addition of:
    Code:
    Added to WorldXmlDS.java:
            continentField.setMultiple(true);
    
    Added to onModuleLoad():
            countryGrid.setShowFilterEditor(true);
            countryGrid.setFilterOnKeypress(true);
    Reproduction Steps:
    1) In the FilterBuilder, set Population is not null.
    2) Click the Add Subclause button.
    3) Set Population equals 62099.
    4) Click Filter.
    5) Enter b in the Country field filter.
    Notice that the Population = 62099 has been lost.
    Attached Files
    Last edited by pghosh; 30 Mar 2015, 10:48. Reason: adding screenshot

    #2
    Any update on this? It seems to always lose criteria with an "Any" subclause.

    Comment


      #3
      We see the issue and we're looking into it - but it's a complex area. We'll update here when it's been fixed.

      Comment


        #4
        Thank you.

        Comment


          #5
          Our customers have been waiting on this for a while and now is a blocker for us... we're hoping to release this in August.

          Comment


            #6
            Apologies - this one slipped through the priority net a bit, in favour of issues from customers with support contracts.

            But we'll aim for a fix in the next few days.

            Comment


              #7
              I believe we've renewed our support contract. Any update on this fix?

              Comment


                #8
                We'll take a look over the weekend.

                Comment


                  #9
                  We've made some framework changes to address this in our development branch (5.1) - given no unforeseen side-effects to the changes, we'll port them back to 5.0 for tomorrow's build.

                  Comment


                    #10
                    Hi Isomorphic,

                    We're still seeing some issues with this on v10.0p_2015-07-02. I'm using Chrome 43.

                    Test Steps (using the same sample code): I did match all, population is not null. Sub clause, match any [country equals Bermuda, country equals United States].

                    I'm seeing the criteria applied being lost when any field in the filter editor gets input then is removed/cleared. Example, check Member G8 and then deselect.

                    There's also an issue filtering on the Select Item. Click North America after the above test steps.

                    Comment


                      #11
                      I'm attaching files for a slightly modified test case that represents more of what we're doing. Using fetchData(criteria) and ListGrid.setCriteria(criteria) instead of filterData(criteria).

                      Test Steps:
                      1) FilterBuilder: Match All Population is not null, sub clause Match Any [population equals 1, population equals 2].
                      2) Enter B in the Country FilterEditor.

                      Code:
                      data: {_constructor: "AdvancedCriteria", operator: "and",…}
                      _constructor: "AdvancedCriteria"
                      criteria: [{fieldName: "countryName", operator: "iContainsPattern", value: "B"},…]
                      0: {fieldName: "countryName", operator: "iContainsPattern", value: "B"}
                      1: {fieldName: "population", operator: "notNull"}
                      2: {fieldName: "population", operator: "equals", value: "1"}
                      3: {fieldName: "population", operator: "equals", value: "2"}
                      operator: "and"
                      Note that population equals 1 and population equals 2 should be OR'd. Please let me know if I can provide anything else.

                      Thank you.
                      Attached Files

                      Comment


                        #12
                        The difference between this latest sample and the previous one is not the code that applies the criteria, although it's wrong to call both fetchData() and setCriteria() - both do what you expect.

                        The main difference, perhaps we missed it before, is that this code calls setAllowFilterExpressions(true), and it's that setting that's causing your issue. You can see as soon as you press the filter button that the criteria hasn't been interpreted correctly, because there is no "OR" specified in the population field's filter-expression.

                        If you don't switch allowFilterExpressions on, you'll see these criteria work as expected, although you won't be able to edit any of them in the UI - but they'll be retained and applied correctly.

                        We'll take a look at the formItem expression-parser in the next day or so and let you know when we have a fix.
                        Last edited by Isomorphic; 5 Jul 2015, 22:08.

                        Comment


                          #13
                          It turns out that we've never supported, or documented specific support for, this kind of complex editing - that is, editing of nested criteria and multiple conditions on the same field, from an external source, when allowFilterExpressions is true. Up to now, that's not a feature that the framework intentionally implements.

                          However, since it's July Fourth weekend, and we're nice people, we went ahead and added it to 5.0 for the next nightly build, dated July 6.

                          Note that some nested advancedCriteria will still not be editable, for example, because their tree of nested criteria reference more than one fieldName. Such criteria are retained by the filterEditor and applied silently - they just can't be edited in the grid's UI.

                          We'll update the docs shortly to reflect the new support.

                          Let us know if you see any oddities.

                          Comment


                            #14
                            Thank you very much Isomorphic! I appreciate the prompt action on this. Will update if we see anything.

                            Comment

                            Working...
                            X