Announcement

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

    Problem with databound combo box item filtering

    Browser: Version 83.0.4103.116 (Official Build) (64-bit)
    SmartClient Version: v12.0p_2019-06-12/LGPL Deployment (built 2019-06-12)
    I am not using the SmartClient server framework.

    I am having an issue with combo box fields that have option datasources sometimes not showing all the records coming from the server. I have a combo box field in a ListGrid and do the following:
    1. Call startEditing() on the grid
    2. Click the dropdown icon to filter with an empty value
    3. Select a record from the pick list results
    4. Call either cancelEditing() or endEditing() on the grid
    5. Call startEditing() on the grid again
    6. Click the dropdown icon to filter with an empty value again

    The second call to startEditing() causes the option datasource to immediately send 2 requests to the server. The first response of the first request contains only the record selected from the pick list. The second response contains all expected records. When the pick list opens again, it only displays the first record in the list of records in the second response.

    I've attached a video of the issue occurring.

    The issue only seems to occur when I implement a getPickListFilterCriteria() function for the combo box and provide a default value for a criteria field. Here's the implementation for my example:

    getPickListFilterCriteria: function() {
    return {
    _constructor: "AdvancedCriteria",
    operator: "and",
    criteria: [{
    fieldName: "Job.JobID",
    operator: "startsWith",
    type: "text",
    value: this.getValue() || "" // Removing the default to empty string fixes the issue
    }]
    };
    }

    I have many instances of this throughout my application so I'm hoping I can find a central fix instead of having to change each one.

    Here are the stack traces for the request calls:

    Stack trace causing first request:

    isc_c_Comm_sendXmlHttpRequest (ISC_Core.js:1750)
    isc_c_RPCManager__sendQueue (ISC_DataBinding.js:1232)
    isc_c_RPCManager_sendQueue (ISC_DataBinding.js:1206)
    isc_c_RPCManager_sendNoQueue (ISC_DataBinding.js:1160)
    isc_c_RPCManager_sendRequest (ISC_DataBinding.js:1151)
    isc_c_RPCManager_sendProxied (ISC_DataBinding.js:1145)
    isc_DataSource_sendDSRequest (ISC_DataBinding.js:592)
    isc_DataSource_performDSOperation (ISC_DataBinding.js:561)
    isc_DataSource_fetchData (ISC_DataBinding.js:519)
    isc_c_Class_invokeSuper (ISC_Core.js:292)
    isc_c_Class_Super (ISC_Core.js:284)
    fetchData (BaseGatewayDataSource.js:413)
    isc_ResultSet_fetchRemoteData (ISC_DataBinding.js:1410)
    isc_ResultSet__fetchRemoteData (ISC_DataBinding.js:1405)
    isc_ResultSet_getRangePaged (ISC_DataBinding.js:1559)
    isc_ResultSet__getRangePaged (ISC_DataBinding.js:1547)
    isc_ResultSet_getRange (ISC_DataBinding.js:1387)
    isc_ListGrid_requestVisibleRows (ISC_Grids.js:1611)
    isc_Canvas_filterWithCriteria (ISC_Core.js:4026)
    isc_c_Class_invokeSuper (ISC_Core.js:292)
    isc_c_Class_Super (ISC_Core.js:284)
    isc_ListGrid_filterWithCriteria (ISC_DataBinding.js:1903)
    isc_Canvas__filter (ISC_Core.js:4023)
    isc_c_Class_invokeSuper (ISC_Core.js:292)
    isc_c_Class_Super (ISC_Core.js:284)
    isc_ListGrid__filter (ISC_Grids.js:2209)
    isc_Canvas_filterData (ISC_Core.js:3989)
    filterDataBoundPickList (ISC_Forms.js:2154)
    $19p (ISC_Forms.js:2121)
    filterPickList (ISC_Forms.js:2120)
    setUpPickList (ISC_Forms.js:2077)
    isc_ComboBoxItem_setValueMap (ISC_Forms.js:2694)
    isc_Class_setProperties (ISC_Core.js:350)
    isc_ListGrid_makeEditForm (ISC_Grids.js:1994)
    isc_ListGrid__canFocusInEditor (ISC_Grids.js:2280)
    isc_ListGrid_findNextEditCell (ISC_Grids.js:2268)
    isc_ListGrid_startEditingNew (ISC_Grids.js:2082)
    click (SandboxView.js:65)
    isc_StatefulCanvas_handleActivate (ISC_Foundation.js:213)
    isc_StatefulCanvas_handleClick (ISC_Foundation.js:214)
    isc_c_EventHandler_bubbleEvent (ISC_Core.js:2123)
    isc_c_EventHandler_handleClick (ISC_Core.js:1958)
    isc_c_EventHandler__handleMouseUp (ISC_Core.js:1942)
    isc_c_EventHandler_handleMouseUp (ISC_Core.js:1933)
    isc_c_EventHandler_dispatch (ISC_Core.js:2210)
    (anonymous) (VM10577:3)



    Stack trace causing second request:

    isc_c_Comm_sendXmlHttpRequest (ISC_Core.js:1750)
    isc_c_RPCManager__sendQueue (ISC_DataBinding.js:1232)
    isc_c_RPCManager_sendQueue (ISC_DataBinding.js:1206)
    isc_c_RPCManager_sendNoQueue (ISC_DataBinding.js:1160)
    isc_c_RPCManager_sendRequest (ISC_DataBinding.js:1151)
    isc_c_RPCManager_sendProxied (ISC_DataBinding.js:1145)
    isc_DataSource_sendDSRequest (ISC_DataBinding.js:592)
    isc_DataSource_performDSOperation (ISC_DataBinding.js:561)
    isc_DataSource_fetchData (ISC_DataBinding.js:519)
    isc_c_Class_invokeSuper (ISC_Core.js:292)
    isc_c_Class_Super (ISC_Core.js:284)
    fetchData (BaseGatewayDataSource.js:413)
    isc_ResultSet_fetchRemoteData (ISC_DataBinding.js:1410)
    isc_ResultSet__fetchRemoteData (ISC_DataBinding.js:1405)
    isc_ResultSet_getRangePaged (ISC_DataBinding.js:1559)
    isc_ResultSet__getRangePaged (ISC_DataBinding.js:1547)
    isc_ResultSet_getRange (ISC_DataBinding.js:1387)
    isc_ListGrid_requestVisibleRows (ISC_Grids.js:1611)
    isc_Canvas_filterWithCriteria (ISC_Core.js:4026)
    isc_c_Class_invokeSuper (ISC_Core.js:292)
    isc_c_Class_Super (ISC_Core.js:284)
    isc_ListGrid_filterWithCriteria (ISC_DataBinding.js:1903)
    isc_Canvas__filter (ISC_Core.js:4023)
    isc_c_Class_invokeSuper (ISC_Core.js:292)
    isc_c_Class_Super (ISC_Core.js:284)
    isc_ListGrid__filter (ISC_Grids.js:2209)
    isc_Canvas_filterData (ISC_Core.js:3989)
    filterDataBoundPickList (ISC_Forms.js:2154)
    $19p (ISC_Forms.js:2121)
    filterPickList (ISC_Forms.js:2120)
    setUpPickList (ISC_Forms.js:2077)
    isc_ComboBoxItem_setValueMap (ISC_Forms.js:2694)
    isc_Class_setProperties (ISC_Core.js:350)
    isc_ListGrid_makeEditForm (ISC_Grids.js:1994)
    isc_ListGrid_showInlineEditor (ISC_Grids.js:1947)
    isc_ListGrid__startEditing (ISC_Grids.js:1934)
    isc_ListGrid_startEditing (ISC_Grids.js:1911)
    isc_ListGrid_startEditingNew (ISC_Grids.js:2085)
    click (SandboxView.js:65)
    isc_StatefulCanvas_handleActivate (ISC_Foundation.js:213)
    isc_StatefulCanvas_handleClick (ISC_Foundation.js:214)
    isc_c_EventHandler_bubbleEvent (ISC_Core.js:2123)
    isc_c_EventHandler_handleClick (ISC_Core.js:1958)
    isc_c_EventHandler__handleMouseUp (ISC_Core.js:1942)
    isc_c_EventHandler_handleMouseUp (ISC_Core.js:1933)
    isc_c_EventHandler_dispatch (ISC_Core.js:2210)
    (anonymous) (VM10577:3)



    It seems this issue came about from a change between SmartClient versions 8.3 and 9.0, as I found that this problem is not happening in the v8.3p_2013-02-13/LGPL Deployment (built 2013-02-13) build but is happening in the v9.0p_2020-04-14/LGPL Deployment (built 2020-04-14) build. I have also verified that it is happening in the latest nightly build of version 12.1. How might I go about debugging this?
    Attached Files

    #2
    You need to be checking comboBox.filterWithValue, see the Combobox Filtering overview

    Comment


      #3
      If I wanted this aspect of my application to work as it did with SmartClient 8.3, would I need to change all custom getPickListFilterCriteria() implementations not to default the criteria field value to an empty string, but just let it be null when getValue() returns null? I would change it to be like this:

      getPickListFilterCriteria: function() {
      return {
      _constructor: "AdvancedCriteria",
      operator: "and",
      criteria: [{
      fieldName: "Job.JobID",
      operator: "startsWith",
      type: "text",
      value: this.getValue()
      }]
      };
      }

      You aren't aware of a change I could make to my datasource base class or some other centralized change to make it work like it did in SmartClient 8.3?

      Comment


        #4
        We’re not aware of this being a change, even a very very old one. But all you need to do is follow the docs we linked above.

        Comment


          #5
          Thank you.

          Comment

          Working...
          X