Announcement

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

    TypeError: _26.split is not a function

    Hi Isomorphic,

    We are experiencing a problem where the user interface becomes unresponsive, and at the source of that problem is the following error stack.

    Code:
    *10:43:38.920:MUP7:WARN:Log:TypeError: _26.split is not a function
    Stack from error.stack:
        processValue() @ xxxx/sc/modules/ISC_DataBinding.js:1112:5118
        FormItem.setValue() @ xxxx/sc/modules/ISC_Forms.js:1100:142
        Class.invokeSuper() @ xxxx/sc/modules/ISC_Core.js:313:158
        SelectItem.setValue() @ xxxx/sc/modules/ISC_Forms.js:2298:907
        DynamicForm.setItemValues() @ xxxx/sc/modules/ISC_Forms.js:425:159
        DynamicForm._addItems() @ xxxx/sc/modules/ISC_Forms.js:284:42
        DynamicForm.addItems() @ xxxx/sc/modules/ISC_Forms.js:277:84
        FilterClause.updateValueItems() @ xxxx/sc/modules/ISC_DataBinding.js:2981:1
        FilterClause.operatorChanged() @ xxxx/sc/modules/ISC_DataBinding.js:2980:301
        changed() @ xxxx/sc/modules/ISC_DataBinding.js:3004:1308
        FormItem.handleChanged() @ xxxx/sc/modules/ISC_Forms.js:1207:17
        FormItem.storeValue() @ xxxx/sc/modules/ISC_Forms.js:1206:18
        FormItem._updateValue() @ xxxx/sc/modules/ISC_Forms.js:1203:63
        SelectItem.updateValue() @ xxxx/sc/modules/ISC_Forms.js:2298:41
        SelectItem.changeToValue() @ xxxx/sc/modules/ISC_Forms.js:2289:86
        SelectItem.pickValue() @ xxxx/sc/modules/ISC_Forms.js:2333:1
        itemClick() @ xxxx/sc/modules/ISC_Forms.js:2013:1
        recordClick() @ xxxx/sc/modules/ISC_Forms.js:2006:136
        ListGrid.rowClick() @ xxxx/sc/modules/ISC_Grids.js:1631:17
        Class.invokeSuper() @ xxxx/sc/modules/ISC_Core.js:313:89
        Class.Super() @ xxxx/sc/modules/ISC_Core.js:305:165
        rowClick() @ xxxx/sc/modules/ISC_Forms.js:2001:191
        anonymous() @ xxxx/sc/modules/ISC_Core.js line 83 > Function:4:105
        GridRenderer._rowClick() @ xxxx/sc/modules/ISC_Grids.js:569:178
        Class.invokeSuper() @ xxxx/sc/modules/ISC_Core.js:313:89
        Class.Super() @ xxxx/sc/modules/ISC_Core.js:305:165
        GridBody._rowClick() @ xxxx/sc/modules/ISC_Grids.js:638:71
        GridRenderer.click() @ xxxx/sc/modules/ISC_Grids.js:567:162
        Canvas.handleClick() @ xxxx/sc/modules/ISC_Core.js:3500:395
        [c]EventHandler.bubbleEvent() @ xxxx/sc/modules/ISC_Core.js:2136:82
        [c]EventHandler.handleClick() @ xxxx/sc/modules/ISC_Core.js:1974:47
        EventHandler._handleMouseUp() @ xxxx/sc/modules/ISC_Core.js:1959:8
        [c]EventHandler.handleMouseUp() @ xxxx/sc/modules/ISC_Core.js:1950:54
        [c]EventHandler.dispatch() @ xxxx/sc/modules/ISC_Core.js:2223:76
        anonymous() @ xxxx/sc/modules/ISC_Core.js line 83 > Function:3:95
    We have not been able to isolate a specific test case at this time, however, we are hoping the above would be beneficial to you.

    SmartClient Version: v12.0p_2018-09-21/Pro Deployment (built 2018-09-21)

    At the time this happens we are changing a filter from "equals" a specific value to "is one of" of multiple values.

    Thanks

    #2
    This indicates the inSet operator's processValue() function is being passed null.

    In the absence of a test-case, please try this patch code at the top of your app - let us know if that works for you and we'll add the change to the framework.

    Code:
    isc.DataSource.getSearchOperator("inSet").processValue = function (value, ds) {
        if (value == null) return null;
        return value.split(this.valueSeparator);
    }
    Last edited by Isomorphic; 31 Jan 2019, 09:26.

    Comment


      #3
      Hi Isomorphic,

      Will give it a try.

      In the code above, is there an erroneous bracket here?

      "inSet"]

      Thanks
      Last edited by stonebranch2; 31 Jan 2019, 09:17.

      Comment


        #4
        Yes, sorry, drop the closing square bracket.

        If this doesn't work for you, log out the value passed in - it's possible it may already be an array, although that is unexpected.
        Last edited by Isomorphic; 31 Jan 2019, 09:39.

        Comment


          #5
          Quick followup.

          It would appear I am getting the following error when applying that code.

          TypeError: isc.DataSource.getSearchOperator is not a function

          Thanks

          Comment


            #6
            Ah yes, sorry, it's an instance method - for this quick test, you can call it on the DS your grid is using, since it returns an element from a static array.
            Last edited by Isomorphic; 31 Jan 2019, 10:12.

            Comment


              #7
              Should it be something like the following?

              Code:
                      isc.DataSource.getSearchOperators()["inSet"].processValue = function (value, ds) {
                          if (value == null) return null;
                          return value.split(this.valueSeparator);
                      }

              Comment


                #8
                The following code:

                Code:
                        isc.DataSource.getSearchOperators()["inSet"].processValue = function (value, ds) {
                            alert("type: " + (typeof value) + ", value: " + value);
                            alert("type: " + (typeof this.valueSeparator) + ", valueSeparator: " + this.valueSeparator);
                            if (value == null) return null;
                            return value.split(this.valueSeparator);
                        }
                Produces the following output:

                Code:
                type: number, value: 190
                type: string, valueSeparator: |
                Code:
                13:14:28.167:MUP7:WARN:Log:TypeError: value.split is not a function
                Stack from error.stack:
                    unnamed() @ :104:14
                    FormItem.setValue() @ xxxx/sc/modules/ISC_Forms.js:1100:142
                    Class.invokeSuper() @ xxxx/sc/modules/ISC_Core.js:313:158
                    SelectItem.setValue() @ xxxx/sc/modules/ISC_Forms.js:2298:907
                    DynamicForm.setItemValues() @ xxxx/sc/modules/ISC_Forms.js:425:159
                    DynamicForm._addItems() @ xxxx/sc/modules/ISC_Forms.js:284:42
                    DynamicForm.addItems() @ xxxx/sc/modules/ISC_Forms.js:277:84
                    FilterClause.updateValueItems() @ xxxx/sc/modules/ISC_DataBinding.js:2981:1
                    FilterClause.operatorChanged() @ xxxx/sc/modules/ISC_DataBinding.js:2980:301
                    changed() @ xxxx/sc/modules/ISC_DataBinding.js:3004:1308
                    FormItem.handleChanged() @ xxxx/sc/modules/ISC_Forms.js:1207:17
                    FormItem.storeValue() @ xxxx/sc/modules/ISC_Forms.js:1206:18
                    FormItem._updateValue() @ xxxx/sc/modules/ISC_Forms.js:1203:63
                    SelectItem.updateValue() @ xxxx/sc/modules/ISC_Forms.js:2298:41
                    SelectItem.changeToValue() @ xxxx/sc/modules/ISC_Forms.js:2289:86
                    SelectItem.pickValue() @ xxxx/sc/modules/ISC_Forms.js:2333:1
                    itemClick() @ xxxx/sc/modules/ISC_Forms.js:2013:1
                    recordClick() @ xxxx/sc/modules/ISC_Forms.js:2006:136
                    ListGrid.rowClick() @ xxxx/sc/modules/ISC_Grids.js:1631:17
                    Class.invokeSuper() @ xxxx/sc/modules/ISC_Core.js:313:89
                    Class.Super() @ xxxx/sc/modules/ISC_Core.js:305:165
                    rowClick() @ xxxx/sc/modules/ISC_Forms.js:2001:191
                    anonymous() @ xxxx/sc/modules/ISC_Core.js line 83 > Function:4:105
                    GridRenderer._rowClick() @ xxxx/sc/modules/ISC_Grids.js:569:178
                    Class.invokeSuper() @ xxxx/sc/modules/ISC_Core.js:313:89
                    Class.Super() @ xxxx/sc/modules/ISC_Core.js:305:165
                    GridBody._rowClick() @ xxxx/sc/modules/ISC_Grids.js:638:71
                    GridRenderer.click() @ xxxx/sc/modules/ISC_Grids.js:567:162
                    Canvas.handleClick() @ xxxx/sc/modules/ISC_Core.js:3500:395
                    [c]EventHandler.bubbleEvent() @ xxxx/sc/modules/ISC_Core.js:2136:82
                    [c]EventHandler.handleClick() @ xxxx/sc/modules/ISC_Core.js:1974:47
                    EventHandler._handleMouseUp() @ xxxx/sc/modules/ISC_Core.js:1959:8
                    [c]EventHandler.handleMouseUp() @ xxxx/sc/modules/ISC_Core.js:1950:54
                    [c]EventHandler.dispatch() @ xxxx/sc/modules/ISC_Core.js:2223:76
                    anonymous() @ xxxx/sc/modules/ISC_Core.js line 83 > Function:3:95
                Last edited by stonebranch2; 31 Jan 2019, 10:20.

                Comment


                  #9
                  Hi Isomorphic,

                  Is it safe for us to use the following workaround?

                  Code:
                          isc.DataSource.getSearchOperators()["inSet"].processValue = function (value, ds) {
                              if (value == null) return null;
                              if (typeof value === "number"){
                                  return (value + "").split(this.valueSeparator);
                              } else {
                                  return value.split(this.valueSeparator);
                              }
                          }
                  That appears to resolve our issue, however, just want to make sure it isn't going to introduce a regression somewhere else.

                  If you have a more appropriate workaround, please let me know.

                  Thanks

                  Comment


                    #10
                    Please confirm
                    - the field data and formItem type
                    - the value in the field when you change operator (which we assume is via the operatorMenu?)
                    - whether the grid has allowFilterExpressions set to true

                    Comment


                      #11
                      You can use it for today as a workaround, but we'll fix it for tomorrow's builds.

                      Comment


                        #12
                        It would be a type="integer".

                        It has a value map of integer value to display name.

                        The form item type would be a SelectItem.

                        <div id="isc_KI" $89="isc_SelectItem_4" $9a="$9d" class="selectItemText" style="width:273px;height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:-moz-block-height;" tabindex="4153" role="option">Cancelled, Failed, Finished</div>

                        Yes, the operator is changed from the user interface using the operator drop-down.

                        The value in there is 190 at the time of changing the operator. This value is of type number, as shown in the earlier post.

                        With respect allowFilterExpressions, we don't use filter expressions, however, this is happening on the filter builder, so wasn't exactly sure what you meant by grid.

                        Comment


                          #13
                          A fix for this issue is now in - please retest with a build dated February 2 or later.

                          Comment


                            #14
                            Thank you

                            Comment

                            Working...
                            X