Announcement

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

    advancedCriteria issue when column filter scrolled out of view

    This issue was seen using SmartClient Version: v9.1p_2014-09-30/Pro Deployment
    using Chrome browser on a Linux platform (Ubuntu).
    Also reproducible on windows7.

    The problem has to do with the way advancedCriteria are handled when using a filterEditor on a ListGrid with an initialCriteria.
    The issue appears to be limited to enum columns.

    I will describe the problem below, followed by steps to reproduce it using the isomorphic showcase.

    ISSUE DETAILS
    For a FilterListGrid with a visible filterEditor and an initialCriteria:
    - add a filter on any enum filter column
    - add many additional columns and scroll all the way to the end (such that the enum column where we added the filter is way out of the view)
    - perform a fetch (search)
    - scroll all the way back to the enum column

    The following was observed on the list grid:
    - the filter editor for the enum column is now blank (our previous filter has disappeared) [this should not happen: the filter should not be wiped]

    The following was observed while debugging the issue:
    - performing another search and inspecting the resultant criteria obtained from getFilterEditorCriteria() shows the initial criteria for the list grid AND the enum criteria which we entered originally (even though the field is now blank).
    - Changing the enum filter to another value will actually append that to the existing criteria during the next search: the existing criteria cannot be removed. [incorrect]

    Additional issues:
    it was observed in the debugger that the criteria corresponding to the enum filter is different when the filter is in view and when it has been scrolled out of view, leading to incorrect results.
    Examples are below:

    Correct enum criteria:

    fieldName: "myField"
    operatoir: "equals"
    value: "442" <--- this is the enum number assigned to this field's value map. The number maps to a string representation.

    Criteria observed when column is out of view:

    filedName: "myField"
    operatoir: "iContains" --> should be "equals"
    value: "myStringValue" --> should be "442", not the string value assigned to the enum.

    This leads to incorrect filtering.

    REPRODUCING ISSUE ON SHOWCASE
    This issue can be reproduced in the isomorphic Filter showcase (https://smartclient.com/#filter) using the following steps:

    - add initial criteria (hardcode it in the js example)
    ex:
    Code:
    initialCriteria: { _constructor: "AdvancedCriteria", operator: "and",
            criteria: [
                { fieldName: "countryName", operator: "equals", value: "Sweden" }]}
    so in this example, we always query for Sweden.
    - move country column to far left, stretch each column wide such that scrollbars appear (since there are very few columns here, the wider the better. Has to be excessively wide to create a very large scrollbar)
    - select continent enum to filter on.
    ex: Asia (for the purposes of this demonstration, do not choose Europe: we want to pick an incorrect continent such that the search returns nothing)
    - scroll all the way to the right and hit filter: no entries are returned (expected).
    - scroll all the way back to the continent enum filter: observe that the filter has disappeared (incorrect).
    - choose the correct continent this time (Europe)
    - hit filter (no need to scroll all the way to the right this time). Observe that no entries are returned even though the correct continent has been specified.

    Reason: behind the scenes, the original filter value of Asia is still present and is being appended to all future queries. As a result, no queries can succeed.

    ADDITIONAL INFO
    The issue described above can be reproduced in a number of ways which result in the filtered column being scrolled out of the view. This includes:
    - adding many additional columns to the list grid and scrolling all the way to the end
    before filtering
    - stretching all the existing columns such that scrollbar appears and scrolling all the way to the end before filtering
    - shrinking the browser window such that the list grid is shrunk and provides a scrollbar

    The problem seems to occur only with enum filters for a filter list grid using advanced criteria.

    When can this be fixed?
    Please let me know if any additional information is required.

    #2
    This looks like an already-fixed bug. Can you try the latest patched version?

    Comment


      #3
      Thank you for the information.

      I will try the newest version and reply again regarding this issue.

      Comment


        #4
        Just tried the above scenario using
        SmartClient Version: v9.1p_2014-11-09/Pro Deployment (built 2014-11-09)
        and the error is still present. Is this something that was fixed in a more recent version?

        I am unable to upgrade my system to the latest version of Smart Client in order to verify this, but the fact that is reproducible in your latest showcase seems to indicate that the issue is still there.

        Comment


          #5
          Any update to this issue?

          Comment


            #6
            This is still being looked into.

            Note that the Showcase is using 10.0p, but not the very most recent patched version - the build date is visible in the lower left.

            Comment


              #7
              Just to keep you informed: There is a real framework issue here which we are still looking at how best to address. We will follow up when we have more information for you on that.

              In the meantime a workaround would be to set 'showAllColumns' to true on your grid's filterEditor:
              Code:
              isc.ListGrid.create({
                 ... // various properties
                 filterEditorProperties:{
                     showAllColumns:true // workaround for possible dropped criteria
                 }
              });
              This basically gets rid of the problem by avoiding the logic which incrementally renders columns within the filter-editor altogether. It could have a performance impact if your grid has a huge number of visible columns - though this is unlikely to be significant in normal usage.

              Regards
              Isomorphic Software

              Comment


                #8
                We've now made a framework change to address this issue.
                Please try the next nightly build, dated Nov 16 or above.
                Change has been applied to 9.1p, 10.0p and 10.1d branches

                Regards
                Isomorphic Software

                Comment


                  #9
                  Thank you for the prompt follow-up and quick resolution of the issue.

                  Comment

                  Working...
                  X