Announcement

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

    Different behavior in smartclient V12 and V13 when doing a setShowFilterEditor

    browser : all, OS: Windows 10.0, SC Version 13.0 8/29/2022
    Desccription: after a fetchData on a Grid, a grid.setShowFilterEditor(false) and a grid.setShowFilterEditor(true) will result in a fetchData.
    In my production application a programmatic grid.fetchData() afterwards then will not do a fetch. In the demo that I added only the dataFetch effect can be seen.
    Demo:
    open : SmartClient™ v13.0p_2022-08-30 Showcase
    open console
    replace code with this code:
    // demo code
    Code:
    isc.ListGrid.create({
    ID: "countryList",
    width:500, height:224, alternateRecordStyles:true,
    dataSource: worldDS,
    fetchData: function (criteria, callback, requestProperties) {
    isc.logEcho("caller:" + arguments.callee.caller.name + "->willFetch:" + this.willFetchData (criteria));
    this.Super('fetchData', arguments);
    },
    
    // display a subset of fields from the datasource
    fields:[
    {name:"countryCode"},
    {name:"countryName"},
    {name:"capital"},
    {name:"continent"}
    ],
    sortField: 1, // sort by countryName
    dataPageSize: 50,
    drawAheadRatio: 4
    })
    
    
    
    isc.IButton.create({
    ID: "fetchUS", width:140,
    title:"Fetch Code: US",
    click:"countryList.fetchData({countryCode:'US'})"
    })
    
    
    isc.IButton.create({
    ID: "fetchEurope",
    autoFit:true, minWidth:140,
    title:"Fetch Continent: Europe",
    click:"countryList.fetchData({continent:'Europe'})"
    })
    
    
    isc.IButton.create({
    ID: "fetchAll", width:140,
    title:"Fetch All",
    click:"countryList.fetchData()"
    })
    
    isc.IButton.create({
    ID: "showFilter",
    width:150,
    title:"showFilterEditor",
    click:"countryList.setShowFilterEditor(true)"
    })
    
    isc.IButton.create({
    ID: "hideFilter",
    left:680, top:240, width:150,
    title:"hideFilterEditor",
    click:"countryList.setShowFilterEditor(false)"
    })
    
    isc.HStack.create({
    top: 240, width: "100%",
    membersMargin: 20,
    members: [fetchUS, fetchEurope, fetchAll, showFilter, hideFilter]
    });
    Last edited by Isomorphic; 30 Aug 2022, 15:01.

    #2
    What was the exact version of "v12" where you saw a different behavior?

    Comment


      #3
      In v12.1p_2022-06-11 a "setShowFilterEditor(false)" followed by "setShowFilterEditor(true)" does not lead to a "fetchData".
      But in v13.0p_2022-08-29 this 2 calls will be followed by a "fetchData" .

      Comment


        #4
        The application is already some years old. And I never saw the described behavior in the past under V10, V11 or V12 versions.

        Comment


          #5
          It's not clear what you're describing. Open the Developer Console's RPC tab and then describe exactly what buttons you clicked in your repro code, and what you saw in the RPC tab, and explain the difference in these results between the versions.

          Comment


            #6
            In both versions I clicked the buttons
            1. "Fetch Continent: Europe"
            2. "showFilterEditor"
            3. "hideFilterEditor"

            In Version 13.0 the output in the "RPC" Tab is: see RPC 13-screenshot
            you will see 2 RPC.
            V13 Log Messages:
            08:58:44.336:MUP0:WARN:Log:"caller:anonymous->willFetch:true"
            08:58:48.934:MUP9:WARN:Log:"caller:isc_ListGrid_setShowFilterEditor->willFetch:true"
            also two lines


            In Version 12 the output in the "RPC"-Tab is: see RPC 12-screenshot
            you will see 1 RPC
            V12 Log Messages:
            09:11:04.260:MUP8:WARN:Log:"caller:anonymous->willFetch:true"
            also only ONE Line
            Attached Files
            Last edited by paulwilhelm; 31 Aug 2022, 23:16. Reason: clarification

            Comment


              #7
              second attachment
              Attached Files

              Comment


                #8
                paulwilhelm,
                It will help for sure to see the respective requests, especially for the one with the two requests.
                They shouldn’t be the same, subtle differences like textMatchStyle.

                Best regards
                Blama

                Comment


                  #9
                  It is easy to reproduce the effect:
                  For each databound Grid where autoFetchData=false, like (...showcase/?id=databoundFilter; ..showcase/?id=databoundFetch) you may do the following three steps:

                  countryList.filterData({countryName:'United'})
                  countryList.setShowFilterEditor(true)
                  countryList.setShowFilterEditor(false)

                  you will see 2 RPC in Version 13.0 but only 1 RPC in Version 12.x
                  the requests in Version 13

                  the first one (filterData):

                  {
                  "actionURL":"http://localhost/smartclient13DEV/isomorphic/IDACall",
                  "showPrompt":true,
                  "prompt":"Finding Records that match your criteria...",
                  "transport":"xmlHttpRequest",
                  "promptStyle":null,
                  "bypassCache":true,
                  "data":{
                  "criteria":{
                  "countryName":"United"
                  },
                  "operationConfig":{
                  "dataSource":"worldDS",
                  "repo":null,
                  "operationType":"fetch",
                  "textMatchStyle":"substring"
                  },
                  "startRow":0,
                  "endRow":62,
                  "sortBy":[
                  "countryName"
                  ],
                  "componentId":"countryList",
                  "appID":"builtinApplication",
                  "operation":"worldDS_fetch",
                  "oldValues":{
                  "countryName":"United"
                  }
                  }
                  }

                  the second one (setShowFilterEditor(false)):

                  {
                  "actionURL":"http://localhost/smartclient13DEV/isomorphic/IDACall",
                  "showPrompt":true,
                  "prompt":"Finding Records that match your criteria...",
                  "transport":"xmlHttpRequest",
                  "promptStyle":null,
                  "bypassCache":true,
                  "data":{
                  "criteria":{
                  },
                  "operationConfig":{
                  "dataSource":"worldDS",
                  "repo":null,
                  "operationType":"fetch",
                  "textMatchStyle":"exact"
                  },
                  "startRow":0,
                  "endRow":62,
                  "sortBy":[
                  "countryName"
                  ],
                  "componentId":"countryList",
                  "appID":"builtinApplication",
                  "operation":"worldDS_fetch",
                  "oldValues":{
                  }
                  }
                  }

                  Version 12
                  the 1 st and only request:


                  {
                  "actionURL":"http://localhost/smartclient121DEV/isomorphic/IDACall",
                  "showPrompt":true,
                  "prompt":"Finding Records that match your criteria...",
                  "transport":"xmlHttpRequest",
                  "promptStyle":null,
                  "bypassCache":true,
                  "data":{
                  "criteria":{
                  "countryCode":"US"
                  },
                  "operationConfig":{
                  "dataSource":"worldDS",
                  "repo":null,
                  "operationType":"fetch",
                  "textMatchStyle":"exact"
                  },
                  "startRow":0,
                  "endRow":62,
                  "sortBy":[
                  "countryName"
                  ],
                  "componentId":"countryList",
                  "appID":"builtinApplication",
                  "operation":"worldDS_fetch",
                  "oldValues":{
                  "countryCode":"US"
                  }
                  }
                  }



                  Comment


                    #10
                    Note. In the future, please enclose your code within code tags (add using the button with "sharp" icon), as that will preserve indentation.
                    Last edited by Isomorphic; 1 Sep 2022, 11:56.

                    Comment


                      #11
                      We see the issue you're talking about, which is that when the filter editor is closed, the current criteria on the grid seem to be getting cleared in 13.0. That's why the extra fetch gets issued - because the null criteria is broader than the original.

                      We'll look into this, but without support, we can't guarantee the fix within a particular time frame.

                      Comment


                        #12
                        In your last response you notice a lacking support. I'm not sure whether I was meant. Perhaps you can make it clearer.
                        But I want to make clear that this issue is not a meaningless trifle to me.
                        In the use case where I saw this behavior it is crucial that all "fetchData()" calls to the
                        server are controlled and watched by the application because the transmitted criteria leads to a business logic object that inserts data into the database and then returns data to the client.
                        After the update from v12 to v13 the additional calls by "setShowFilterEditor(false)" to the server that were initiated by hundreds of employees with their smartphones, a great part of data was corrupted and had to be corrected afterwards.


                        Comment


                          #13
                          Take a look here to see the different levels of support service available. If you believe you've already paid for support, then let us know as we're not seeing it. Without support, your issue will be considered if we feel it's important, but we can't guarantee a time frame in which a fix will be released.

                          Comment


                            #14
                            Just a further note here: in 13.0 we introduced the ability for end users to hide and show the filterEditor dynamically. If an end user hides the filterEditor after entering criteria, clearly those criteria must be cleared, otherwise you have a serious UX issue: criteria exist and the user can't see them.

                            To understand how bad this is, imagine also that the user may leave the screen for a while and return, or criteria may be restored automatically as part of a saved search, but be invisible, etc.

                            So the new behavior is definitely the correct behavior, and no previous behavior w.r.t. to criteria was documented. In the fact, the API was only introduced to help a specific customer with a strange order-of-operations issue.

                            In your app, how are you dealing with the serious UX issue of hidden criteria? If it doesn't come up, that suggests that you are using this API for some non-UX housekeeping reason, and with more context on why you would need to show/hide the filterEditor dynamically, we might be able to suggest a better, supported approach.



                            Comment

                            Working...
                            X