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:
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.
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" }]}
- 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.
Comment