Announcement

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

    ListGrid implicitCriteria + groupBy and records more than groupByMaxRecords data refresh bug (12.0/12.1/13.0p)

    Hi Isomorphic,

    please see this modified sample (v12.1p_2022-08-24, as I want to switch to 12.1p, but also current 12.0p, 13.0p).
    The testcase has more buttons than it needs. I found out only while building it according to my app, that the issue is actually related to groupByMaxRecords and only then to implicitCriteria (normal filterRow is working fine).
    Also, if you remove groupByMaxRecords, everything regarding implicitCriteria-changes is fine.

    Steps to reproduce (Win10/FF 103, Chromium 103):
    • Start (starts with criteria for all continents, 216 rows, more than the configured 175 for groupByMaxRecords)
    • Click "inSet: AS..." (without Africa)
    • Note that the ListGrid does not load new data (unexpected)
    • Hover the ListGrid body
    • Turn the mouse wheel down
    • Note that the ListGrid does only now load new data with the new implicitCriteria
    • Repeat with different implicitCriteria
    Best regards
    Blama

    Code:
    isc.ListGrid.create({
        ID: "filterGrid",
        width: 850,
        height: 500,
        alternateRecordStyles: true,
        dataSource: worldDS,
        autoFetchData: true,
        groupByField: "continent",
        groupStartOpen: "all",
        sortField: "continent",
        groupByMaxRecords: 80,
        sortByGroupFirst: "true",
        implicitCriteria: {
            _constructor: "AdvancedCriteria",
            operator: "and",
            criteria: [{
                fieldName: "continent",
                operator: "inSet",
                value: ["Africa", "Asia", "Australia/Oceania", "Europe", "North America", "South America"]
            }]
        },
        fields: [{
            name: "countryCode",
            width: 60
        }, {
            name: "government",
        }, {
            name: "continent",
        }, {
            name: "capital",
        }, {
            name: "independence",
            width: 100
        }, {
            name: "population",
            width: 100
        }, {
            name: "gdp",
            width: 85
        }]
    });
    
    // Implicit criteria Buttons
    isc.IButton.create({
        ID: "europeAsiaBtn",
        width: 250,
    
        title: "inSet: AF/AS/AU/EU/NA/SA (=all)",
        click: function() {
            filterGrid.setImplicitCriteria({
                _constructor: "AdvancedCriteria",
                operator: "and",
                criteria: [{
                    fieldName: "continent",
                    operator: "inSet",
                    value: ["Africa", "Asia", "Australia/Oceania", "Europe", "North America", "South America"]
                }]
            });
        }
    });
    isc.IButton.create({
        ID: "europeAsiaAusBtn",
        width: 250,
    
        title: "inSet: AS/AU/EU/NA/SA",
        click: function() {
            filterGrid.setImplicitCriteria({
                _constructor: "AdvancedCriteria",
                operator: "and",
                criteria: [{
                    fieldName: "continent",
                    operator: "inSet",
                    value: ["Asia", "Australia/Oceania", "Europe", "North America", "South America"]
                }]
            });
        }
    });
    isc.IButton.create({
        ID: "allCtnBtn",
        width: 250,
    
        title: "All continents (null criteria)",
        click: function() {
            filterGrid.setImplicitCriteria(null);
        }
    });
    isc.HStack.create({
        ID: "criteriaBtnStack",
        membersMargin: 30,
        height: 1,
        members: [
            isc.Label.create({
                contents: "Implicit Criteria:",
                height: 1
            }), europeAsiaBtn, europeAsiaAusBtn, allCtnBtn
        ]
    });
    
    
    // Filter criteria Buttons
    isc.IButton.create({
        ID: "showFilterRowBtn",
        width: 250,
        title: "Show filterRow",
        click: function() {
            filterGrid.setShowFilterEditor(true);
        }
    });
    isc.IButton.create({
        ID: "hideFilterRowBtn",
        width: 250,
        title: "Reset fR + hide: setFEdCrit(null) + fetchData()",
        click: function() {
            filterGrid.setFilterEditorCriteria(null);
            filterGrid.setShowFilterEditor(false);
            filterGrid.fetchData();
        }
    });
    isc.IButton.create({
        ID: "resetFilterRowBtn",
        width: 250,
        title: "Reset fR: setFEdCrit(null) + fetchData()",
        click: function() {
            filterGrid.setFilterEditorCriteria(null);
            filterGrid.fetchData();
        }
    });
    isc.IButton.create({
        ID: "resetFilterBtn",
        width: 250,
        title: "Reset fR: filterData(null)",
        click: function() {
            filterGrid.filterData(null);
        }
    });
    isc.HStack.create({
        ID: "filterBtnStack",
        height: 1,
        membersMargin: 30,
        members: [
            isc.Label.create({
                contents: "Filter:",
                height: 1
            }),
            showFilterRowBtn, hideFilterRowBtn, resetFilterRowBtn, resetFilterBtn
        ]
    });
    
    isc.VStack.create({
        membersMargin: 30,
        members: [
            criteriaBtnStack, filterBtnStack, filterGrid
        ]
    });

    #2
    Hi Isomorphic,

    could you reproduce the problem or do you need more details?

    Thank you & Best regards
    Blama

    Comment


      #3
      Apologies for the delay in getting back to you - yes, it's been assigned and we'll update here shortly when we have more information.

      Comment


        #4
        hi Blama ,

        Sorry for the delay on this one - it's been addressed for tomorrow's builds of affected branches

        You can likely work around it in the meantime, by calling markForRedraw() on your grid after setImplicitCriteria().

        Comment


          #5
          Hi Isomorphic,

          there are no new builds for today as of now, but I can see that the sample code from #1 + filterGrid.markForRedraw() works in v12.1p_2022-09-09. Thank you very much.
          I'll also test that in my application.
          If markForRedraw() works there as well, I might stay with my version (v12.1p_2022-08-10), as quite some time of manual testing went in there already.

          Thank you & Best regards
          Blama

          Comment


            #6
            Hi Isomorphic,

            it seems to work as expected with v12.1p_2022-08-10 + filterGrid.markForRedraw() in my application.

            Thanks a lot,
            Blama

            Comment


              #7
              You should still take tomorrow's build of 12.1 to pick up the fix (which has been refined today).

              The problem was actually that, in a grid with a groupByMaxRecords value, the initial fetch for data sets an internal flag to temporarily prevent dataChanged() from issuing a redraw - but the flag wasn't being cleared, in this case, so dataChanged() was never redrawing the grid after that point, unless a regroup had been performed.
              Last edited by Isomorphic; 13 Sep 2022, 04:52.

              Comment


                #8
                Hi Isomorphic,

                I tried my code that is working fine with v12.1p_2022-08-10 now with v12.1p_2022-09-29 and seem to have problems.
                I get this exception (row numbers modules-debug). As setDbcImplicitCriteria() is mentioned, I assume this might be related to your change.

                Best regards
                Blama

                Code:
                *19:04:42.323:XRP9:WARN:Log:Uncaught exception escaped: com.google.gwt.core.client.JavaScriptException
                (TypeError) : d.setDbcImplicitCriteria is not a function
                    at setImplicitCriteria(https://lms.localhost/lms/sc/modules/ISC_Core.js?isc_version=v12.1p_2022-09-29.js)
                    at setProperties(https://lms.localhost/lms/sc/modules/ISC_Core.js?isc_version=v12.1p_2022-09-29.js)
                    at setProperty(https://lms.localhost/lms/sc/modules/ISC_Core.js?isc_version=v12.1p_2022-09-29.js)
                    at _cb(https://lms.localhost/ line 10 > injectedScript)
                    at Mcb(https://lms.localhost/ line 10 > injectedScript)
                    at rtc(https://lms.localhost/ line 10 > injectedScript)
                    at Aqc(https://lms.localhost/ line 10 > injectedScript)
                    at Bqc(https://lms.localhost/ line 10 > injectedScript)
                    at ekc(https://lms.localhost/ line 10 > injectedScript)
                    at _Hc(https://lms.localhost/ line 10 > injectedScript)
                    at ykc(https://lms.localhost/ line 10 > injectedScript)
                    at Akc(https://lms.localhost/ line 10 > injectedScript)
                    at Fkc(https://lms.localhost/ line 10 > injectedScript)
                    at ezb(https://lms.localhost/ line 10 > injectedScript)
                    at fzb(https://lms.localhost/ line 10 > injectedScript)
                    at Ayb(https://lms.localhost/ line 10 > injectedScript)
                    at mqe/<(https://lms.localhost/ line 10 > injectedScript)
                    at Zc(https://lms.localhost/ line 10 > injectedScript)
                    at ad(https://lms.localhost/ line 10 > injectedScript)
                    at _c/<(https://lms.localhost/ line 10 > injectedScript)
                    at fireCallback(https://lms.localhost/lms/sc/modules/ISC_Core.js?isc_version=v12.1p_2022-09-29.js)
                    at fireCallback(https://lms.localhost/lms/sc/modules/ISC_Core.js?isc_version=v12.1p_2022-09-29.js)
                    at _performTransactionReply(https://lms.localhost/lms/sc/modules/ISC_DataBinding.js?isc_version=v12.1p_2022-09-29.js)
                    at performTransactionReply(https://lms.localhost/lms/sc/modules/ISC_DataBinding.js?isc_version=v12.1p_2022-09-29.js)
                    at anonymous(https://lms.localhost/lms/sc/modules/ISC_Core.js?isc_version=v12.1p_2022-09-29.js line 2511 > Function)
                    at fireCallback(https://lms.localhost/lms/sc/modules/ISC_Core.js?isc_version=v12.1p_2022-09-29.js)
                    at performXmlTransactionReply(https://lms.localhost/lms/sc/modules/ISC_Core.js?isc_version=v12.1p_2022-09-29.js)
                    at anonymous(https://lms.localhost/lms/sc/modules/ISC_Core.js?isc_version=v12.1p_2022-09-29.js line 2511 > Function)
                    at fireCallback(https://lms.localhost/lms/sc/modules/ISC_Core.js?isc_version=v12.1p_2022-09-29.js)
                    at _fireXMLCallback(https://lms.localhost/lms/sc/modules/ISC_Core.js?isc_version=v12.1p_2022-09-29.js)
                    at loadFunc(https://lms.localhost/lms/sc/modules/ISC_Core.js?isc_version=v12.1p_2022-09-29.js)
                    at EventHandlerNonNull*sendXmlHttpRequest(https://lms.localhost/lms/sc/modules/ISC_Core.js?isc_version=v12.1p_2022-09-29.js)
                    at _sendQueue(https://lms.localhost/lms/sc/modules/ISC_DataBinding.js?isc_version=v12.1p_2022-09-29.js)
                    at sendQueue(https://lms.localhost/lms/sc/modules/ISC_DataBinding.js?isc_version=v12.1p_2022-09-29.js)
                    at mqe(https://lms.localhost/ line 10 > injectedScript)
                    at RAb(https://lms.localhost/ line 10 > injectedScript)
                    at pyb(https://lms.localhost/ line 10 > injectedScript)
                    at callback<(https://lms.localhost/ line 10 > injectedScript)
                    at Zc(https://lms.localhost/ line 10 > injectedScript)
                    at ad(https://lms.localhost/ line 10 > injectedScript)
                    at _c/<(https://lms.localhost/ line 10 > injectedScript)
                    at fireCallback(https://lms.localhost/lms/sc/modules/ISC_Core.js?isc_version=v12.1p_2022-09-29.js)
                    at fireCallback(https://lms.localhost/lms/sc/modules/ISC_Core.js?isc_version=v12.1p_2022-09-29.js)
                    at fireReplyCallback(https://lms.localhost/lms/sc/modules/ISC_DataBinding.js?isc_version=v12.1p_2022-09-29.js)
                    at isc.RPCManager.fireReplyCallback(https://lms.localhost/ line 10 > injectedScript)
                    at fireReplyCallbacks(https://lms.localhost/lms/sc/modules/ISC_DataBinding.js?isc_version=v12.1p_2022-09-29.js)
                    at performOperationReply(https://lms.localhost/lms/sc/modules/ISC_DataBinding.js?isc_version=v12.1p_2022-09-29.js)
                    at _performTransactionReply(https://lms.localhost/lms/sc/modules/ISC_DataBinding.js?isc_version=v12.1p_2022-09-29.js)
                    at performTransactionReply(https://lms.localhost/lms/sc/modules/ISC_DataBinding.js?isc_version=v12.1p_2022-09-29.js)
                    at anonymous(https://lms.localhost/lms/sc/modules/ISC_Core.js?isc_version=v12.1p_2022-09-29.js line 2511 > Function)
                    at fireCallback(https://lms.localhost/lms/sc/modules/ISC_Core.js?isc_version=v12.1p_2022-09-29.js)
                    at performXmlTransactionReply(https://lms.localhost/lms/sc/modules/ISC_Core.js?isc_version=v12.1p_2022-09-29.js)
                    at anonymous(https://lms.localhost/lms/sc/modules/ISC_Core.js?isc_version=v12.1p_2022-09-29.js line 2511 > Function)
                    at fireCallback(https://lms.localhost/lms/sc/modules/ISC_Core.js?isc_version=v12.1p_2022-09-29.js)
                    at _fireXMLCallback(https://lms.localhost/lms/sc/modules/ISC_Core.js?isc_version=v12.1p_2022-09-29.js)
                    at loadFunc(https://lms.localhost/lms/sc/modules/ISC_Core.js?isc_version=v12.1p_2022-09-29.js)
                    at EventHandlerNonNull*sendXmlHttpRequest(https://lms.localhost/lms/sc/modules/ISC_Core.js?isc_version=v12.1p_2022-09-29.js)
                    at _sendQueue(https://lms.localhost/lms/sc/modules/ISC_DataBinding.js?isc_version=v12.1p_2022-09-29.js)
                    at sendQueue(https://lms.localhost/lms/sc/modules/ISC_DataBinding.js?isc_version=v12.1p_2022-09-29.js)
                    at sendRequest(https://lms.localhost/lms/sc/modules/ISC_DataBinding.js?isc_version=v12.1p_2022-09-29.js)
                    at nqe(https://lms.localhost/ line 10 > injectedScript)
                    at dyb(https://lms.localhost/ line 10 > injectedScript)
                    at j9(https://lms.localhost/ line 10 > injectedScript)
                    at g(https://lms.localhost/ line 10 > injectedScript)
                    at Zc(https://lms.localhost/ line 10 > injectedScript)
                    at ad(https://lms.localhost/ line 10 > injectedScript)
                    at _c/<(https://lms.localhost/ line 10 > injectedScript)
                    at a9(https://lms.localhost/ line 10 > injectedScript)
                    at anonymous(lms-0.js)
                    at m(https://lms.localhost/lms/lms.nocache.js)
                    at onScriptDownloaded/<(https://lms.localhost/lms/lms.nocache.js)
                    at d(https://lms.localhost/lms/lms.nocache.js)
                    at handleEvent*l(https://lms.localhost/lms/lms.nocache.js)
                    at onScriptDownloaded(https://lms.localhost/lms/lms.nocache.js)
                    at anonymous(https://lms.localhost/lms/F743C19BA3C5B4CAD86D24A5B6EF30BF.cache.js)
                    at anonymous()

                Comment


                  #9
                  Hi Blama
                  Can you clarify how exactly you're getting this JS error?

                  We tried copy/pasting the code from post #1 to the sample here: https://www-demos.smartclient.com/sm...advancedFilter
                  [At the time of posting, this is currently running 12.1 from 2022/09/29]
                  We don't see the error on load or from following your original steps

                  Thanks

                  Comment


                    #10
                    Hi Isomorphic,

                    yes, that was in my application, not in the testcase. I'll try to reproduce in the testcase.

                    Best regards
                    Blama

                    Comment


                      #11
                      We still can't reproduce, but the basic problem seems to be that there is no ResultSet available when setImplicitCriteria() runs. We'll address the crash, of course, but it would still be useful to know how you're hitting it.

                      Perhaps your app uses a TreeGrid, or applies a manual Tree or ResultTree as data, or setImplicitCriteria() may be being called before grid.data has been initialized.
                      Last edited by Isomorphic; 12 Oct 2022, 01:47.

                      Comment


                        #12
                        Hi Isomorphic,

                        yes, this sounds familiar. I've always had this 1st line in my log, which is now directly before the exception in question. I'll try to reproduce.
                        But there is no Tree or ResultTree or manual providing of data in my code. Data comes from a fetchData() call.
                        Code:
                        *19:15:50.458:XRP0:WARN:Log:getResultSet(): data is not a ResultSet; returning null (if grouped, use getOriginalResultSet(); if unbound, use getRecordList(); can only be called on DataBoundComponents after initial data has been fetched)
                        *19:15:50.656:XRP0:WARN:Log:Uncaught exception escaped: com.google.gwt.core.client.JavaScriptException
                        (TypeError) : d.setDbcImplicitCriteria is not a function
                            at setImplicitCriteria(https://lms.localhost/lms/sc/modules/ISC_Core.js?isc_version=v12.1p_2022-09-29.js)
                            at setProperties(https://lms.localhost/lms/sc/modules/ISC_Core.js?isc_version=v12.1p_2022-09-29.js)
                        Best regards
                        Blama

                        Comment


                          #13
                          Hi Isomorphic,

                          here a testcase that shows the issue using v12.1p_2022-09-29:
                          Code:
                          isc.ListGrid.create({
                              ID: "filterGrid",
                              width: 850,
                              height: 500,
                              alternateRecordStyles: true,
                              dataSource: worldDS,
                              autoFetchData: false,
                              groupByField: "continent",
                              groupStartOpen: "all",
                              sortField: "continent",
                              groupByMaxRecords: 80,
                              sortByGroupFirst: "true",
                              implicitCriteria: {
                                  _constructor: "AdvancedCriteria",
                                  operator: "and",
                                  criteria: [{
                                      fieldName: "continent",
                                      operator: "inSet",
                                      value: ["Africa", "Asia", "Australia/Oceania", "Europe", "North America", "South America"]
                                  }]
                              },
                              fields: [{
                                  name: "countryCode",
                                  width: 60
                              }, {
                                  name: "government",
                              }, {
                                  name: "continent",
                              }, {
                                  name: "capital",
                              }, {
                                  name: "independence",
                                  width: 100
                              }, {
                                  name: "population",
                                  width: 100
                              }, {
                                  name: "gdp",
                                  width: 85
                              }]
                          });
                          
                          isc.IButton.create({
                              ID: "justFetch",
                              width: 250,
                              title: "Just fetchData() (OK)",
                              click: function() {
                                  filterGrid.fetchData();
                              }
                          });
                          
                          isc.IButton.create({
                              ID: "justIC",
                              width: 250,
                              title: "Just setImplicitCriteria (not OK)",
                              click: function() {
                                  filterGrid.setImplicitCriteria({
                                      _constructor: "AdvancedCriteria",
                                      operator: "and",
                                      criteria: [{
                                          fieldName: "continent",
                                          operator: "inSet",
                                          value: ["Europe", "North America", "South America"]
                                      }]
                                  });
                              }
                          });
                          
                          isc.IButton.create({
                              ID: "icPlusFetch",
                              width: 250,
                          
                              title: "setImplicitCriteria() + fetchData() (not OK)",
                              click: function() {
                                  filterGrid.setImplicitCriteria(null);
                                  filterGrid.fetchData();
                              }
                          });
                          isc.HStack.create({
                              ID: "btnStack",
                              membersMargin: 30,
                              height: 1,
                              members: [
                                  justFetch, justIC, icPlusFetch
                              ]
                          });
                          
                          isc.VStack.create({
                              membersMargin: 30,
                              members: [
                                  btnStack, filterGrid
                              ]
                          });
                          In my SmartGWT application I also set the implicitCriteria with the function, as the property does not exist like it does in JavaScript.

                          Best regards
                          Blama

                          Comment


                            #14
                            hi Blama ,

                            We've addressed this crash for today's builds, dated October 18 and later.

                            Your code got here because the grid is both grouped and autoFetchData:false, and no previous fetch had occurred - the grid is drawn/initialized so, since it's grouped, grid.data is an isc.Tree but, since nothing has been fetched, grid.originalData is not yet a ResultSet. If the grid had fetched previously, you wouldn't have hit this crash.

                            Anyway - with the crash resolved, note that a call to setImplicitCriteria() in this situation (sans any fetch, so your sample's second button) will apply your criteria to the grid itself, but will not cause an automatic refresh, because there is still no ResultSet for it to filter. This is also how setCriteria() behaves in this scenario.

                            We're considering a new param to override that fetching behavior and a callback to better interact with that flow. We'll update here when we have more information on that.

                            Comment


                              #15
                              Hi Isomorphic,

                              using v12.1p_2022-10-18 and the testcase from #13 the exception is gone and there is no fetch for the 2nd button, like you say.
                              This already helps and together with your explanation from #14 I'm pretty sure that also my ResultSet-warning, that I could never explain, but that also did not cause problems, will be gone.
                              There is another issue, though: I believe the criteria is applied twice. See this request for a click on the 1st button.

                              Best regards
                              Blama

                              Code:
                              {
                                  dataSource:"worldDS",
                                  operationType:"fetch",
                                  componentId:"filterGrid",
                                  data:{
                                      operator:"and",
                                      criteria:[
                                          {
                                              fieldName:"continent",
                                              operator:"inSet",
                                              value:[
                                                  "Africa",
                                                  "Asia",
                                                  "Australia/Oceania",
                                                  "Europe",
                                                  "North America",
                                                  "South America"
                                              ]
                                          }[B],
                                          {
                                              fieldName:"continent",
                                              operator:"inSet",
                                              value:[
                                                  "Africa",
                                                  "Asia",
                                                  "Australia/Oceania",
                                                  "Europe",
                                                  "North America",
                                                  "South America"
                                              ]
                                          }[/B]
                                      ]
                                  },
                                  startRow:0,
                                  endRow:80,
                                  sortBy:[
                                      "continent"
                                  ],
                                  textMatchStyle:"exact",
                                  resultSet:[ResultSet ID:isc_ResultSet_0 (dataSource: worldDS, created by: filterGrid)],
                                  callback:{
                                      caller:[ResultSet ID:isc_ResultSet_0 (dataSource: worldDS, created by: filterGrid)],
                                      methodName:"fetchRemoteDataReply"
                                  },
                                  willHandleError:true,
                                  showPrompt:true,
                                  prompt:"Finding Records that match your criteria...",
                                  oldValues:{
                                      operator:"and",
                                      criteria:[
                                          {
                                              fieldName:"continent",
                                              operator:"inSet",
                                              value:[
                                                  "Africa",
                                                  "Asia",
                                                  "Australia/Oceania",
                                                  "Europe",
                                                  "North America",
                                                  "South America"
                                              ]
                                          },
                                          {
                                              fieldName:"continent",
                                              operator:"inSet",
                                              value:[
                                                  "Africa",
                                                  "Asia",
                                                  "Australia/Oceania",
                                                  "Europe",
                                                  "North America",
                                                  "South America"
                                              ]
                                          }
                                      ]
                                  },
                                  requestId:"worldDS$6279",
                                  internalClientContext:{
                                      requestIndex:1
                                  },
                                  fallbackToEval:false,
                                  lastClientEventThreadCode:"MUP0",
                                  bypassCache:true,
                                  dataProtocol:"getParams"
                              }

                              Comment

                              Working...
                              X