Announcement

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

    ListGrid#filterData (filterEditor) regression

    Hi Guys!

    we are facing regression in sgwt 2016-08-27 6.0p, (it worked for us in 2016-03-31).
    We have a ListGrid instance grid. And use its filter editor. However, we also allow users to switch to in ui to FilterBuilder (to allow rich filtering).
    We allow users to take advancedCriteria of filterBuilder and set it to grid's filter editor.
    In 2016-03-31p, this worked ok even with "isSet" criterion.
    i.e. In UI, users set their filter in FilterBuilder, they selected "is one of" operator and added few values.
    When they switched back to filterEditor, they could see =(value1|value2) expression and everything worked for them. They also were able to switch back to filterBuilder without any issue.
    However, this is now broken with both 2016-08-27 6.0p and 2016-10-03 6.0p.

    The reason is, that filterBuilder value seems to be somehow preprocessed and broken for isSet. Now, users can see in ui, in filterEditor "=( value1,value2" where =( is rendered as a button
    and underlying objects contain different data.

    Code:
    /*
      having a grid with ds which has sku field....
    */
     String[] arr = {[B]"value1"[/B], [B]"value2"[/B]};
    AdvancedCriteria[] acs = {[B]new [/B]AdvancedCriteria([B]"sku"[/B], OperatorId.[B][I]IN_SET[/I][/B], arr)};
    AdvancedCriteria advancedCriteria = [B]new [/B]AdvancedCriteria(OperatorId.[B][I]AND[/I][/B], acs);  
    /* advancedCriteria.toJson() ==  
    {     "operator":"and",      
           "criteria":[        
            {             "fieldName":"sku",              
                           "operator":"inSet",
                           "value":[
                                        "value1",                  
                                        "value2"             ]
            }     ],
         "_constructor":"AdvancedCriteria"
    }  
    */  
    [B]grid[/B].setShowFilterEditor([B]false[/B]);
    [B]grid[/B].invalidateCache();
    [B]grid[/B].filterData(advancedCriteria); //this seems to be filling [B]grid[/B].getFilterEditorCriteria()  
    
     [B]grid[/B].setShowFilterEditor([B]true[/B]); //this throws warning (attached below)  
    /* value of [B]grid[/B].getFilterEditorCriteria().getJsObj() now is  
     {     "operator":"and",
            "criteria":[
             {
                  "fieldName":"sku",
                  "operator":"inSet",
                 "value":"value1,value2"
            }
        ],
         "_constructor":"AdvancedCriteria"
    }
    */
    As you can see, value of inSet criterion is not an array as it should be imho, but it is converted to a string, which actually breaks our current backend.
    In case we would handle it on our side, we are unable to distinguish commas that are inserted as value separator and commas inserted in data.

    We would very appreciate if you can look into this issue.
    Thank you,
    Tomas

    the warning
    Code:
    *15:49:24.708:IFCS5[E0]:WARN:drawing:isc_AdvancedListGrid_RenameableListGrid_0$31t:draw() called on widget with current drawn state: complete, use redraw() instead.
        Canvas.readyToDraw() on [RecordEditor ID:isc_AdvancedListGrid_RenameableListGrid_0$31t] @ ISC_Core.js:2145:707
        ListGrid.draw(_1=>undef, _2=>undef, _3=>undef, _4=>undef) on [RecordEditor ID:isc_AdvancedListGrid_RenameableListGrid_0$31t] @ ISC_Grids.js:1362:527
        [c]Class.invokeSuper(_1=>null, _2=>"draw", _3=>undef, _4=>undef, _5=>undef, _6=>undef, _7=>undef, _8=>undef, _9=>undef, _10=>undef, _11=>undef, _12=>undef, _13=>undef) on [RecordEditor ID:isc_AdvancedListGrid_RenameableListGrid_0$31t] @ ISC_Core.js:273:93
        [c]Class.Super(_1=>"draw", _2=>[object Arguments], _3=>undef) on [RecordEditor ID:isc_AdvancedListGrid_RenameableListGrid_0$31t] @ ISC_Core.js:265:170
        RecordEditor.draw() on [RecordEditor ID:isc_AdvancedListGrid_RenameableListGrid_0$31t] @ ISC_Grids.js:3212:6
        Layout.layoutChildren(_1=>"resized", _2=>0, _3=>49) on[ListGrid ID:isc_AdvancedListGrid_RenameableListGrid_0] @ ISC_Foundation.js:326:265
        ListGrid.layoutChildren(_1=>"resized", _2=>0, _3=>49) on[ListGrid ID:isc_AdvancedListGrid_RenameableListGrid_0] @ ISC_Grids.js:1291:32
        Canvas._completeResizeBy(_1=>undef) on[ListGrid ID:isc_AdvancedListGrid_RenameableListGrid_0] @ ISC_Core.js:2657:13
        Canvas.resizeBy(_1=>0, _2=>49, _3=>undef, _4=>undef, _5=>undef) on[ListGrid ID:isc_AdvancedListGrid_RenameableListGrid_0] @ ISC_Core.js:2655:6
        Canvas.resizeTo(_1=>940, _2=>487, _3=>undef, _4=>undef, _5=>undef) on[ListGrid ID:isc_AdvancedListGrid_RenameableListGrid_0] @ ISC_Core.js:2668:1115
        Layout.resizeMember(_1=>[ListGrid ID:isc_AdvancedListGrid_RenameableListGrid_0], _2=>487, _3=>Obj, _4=>false, _5=>undef, _6=>undef) on [VLayout ID:isc_PriceGridPageViewImpl_3_0] @ ISC_Foundation.js:276:178
        Layout.resizeMembers(_1=>Array[5], _2=>Array[5], _3=>false, _4=>undef) on [VLayout ID:isc_PriceGridPageViewImpl_3_0] @ ISC_Foundation.js:283:76
        Layout.layoutChildren(<no args: recursion>)  on [VLayout ID:isc_PriceGridPageViewImpl_3_0] @ ISC_Foundation.js:327:130
        Layout.reflowNow(_1=>"member changed visibility: [FilterBuilde..."[72], _2=>7) on [VLayout ID:isc_PriceGridPageViewImpl_3_0] @ ISC_Foundation.js:354:542
        [c]Layout.clearReflowQueue() on [Class Layout] @ ISC_Foundation.js:225:447
        <anonymous>() @ ISC_Foundation.js:225:82
        [c]EventHandler.runTeas() on [Class EventHandler] @ ISC_Core.js:1781:106
        EventHandler._clearThread() on [Class EventHandler] @ ISC_Core.js:1778:136
        FormItem._nativeFocusHandler() @ ISC_Forms.js:637:8
        FormItem.setSelectionRange(_1=>0, _2=>9) on [TextItem ID:isc_TextItem_76 name:sku] @ ISC_Forms.js:1122:108
        FormItem.selectValue() on [TextItem ID:isc_TextItem_76 name:sku] @ ISC_Forms.js:1127:235
        ListGrid._updateEditorSelection(_1=>[TextItem ID:isc_TextItem_76 name:sku]) on [RecordEditor ID:isc_AdvancedListGrid_RenameableListGrid_0$31t] @ ISC_Grids.js:1913:526
        [o]ListGrid._editFormItem_focusInItem() on [TextItem ID:isc_TextItem_76 name:sku] @ ISC_Grids.js:2011:615
        DynamicForm.focusInItem(_1=>"sku", _2=>undef) on [DynamicForm ID:isc_DynamicForm_43] @ ISC_Forms.js:514:17
        ListGrid._startEditing(_1=>0, _2=>1, _3=>undef) on [RecordEditor ID:isc_AdvancedListGrid_RenameableListGrid_0$31t] @ ISC_Grids.js:1905:87
        ListGrid._changeEditCell(_1=>"programmatic", _2=>0, _3=>1, _4=>0, _5=>1) on [RecordEditor ID:isc_AdvancedListGrid_RenameableListGrid_0$31t] @ ISC_Grids.js:1897:46
        ListGrid.startEditing(_1=>0, _2=>1, _3=>undef, _4=>undef, _5=>undef) on [RecordEditor ID:isc_AdvancedListGrid_RenameableListGrid_0$31t] @ ISC_Grids.js:1888:20
        ListGrid.focusInFilterEditor(_1=>"sku") on[ListGrid ID:isc_AdvancedListGrid_RenameableListGrid_0] @ ISC_Grids.js:1214:955
        ListGrid.setFieldSearchOperator(_1=>Obj{name:sku}, _2=>Obj{ID:inSet}) on[ListGrid ID:isc_AdvancedListGrid_RenameableListGrid_0] @ ISC_Grids.js:2700:6
        setCriterion(_12=>Obj) on [TextItem ID:isc_TextItem_76 name:sku] @ ISC_Grids.js:1854:801
        DynamicForm.setValuesAsCriteria(_1=>Obj{_constructor:AdvancedCriteria}, _2=>undef, _3=>undef, _4=>undef) on [DynamicForm ID:isc_DynamicForm_43] @ ISC_Forms.js:305:4
        RecordEditor.draw(<no args: recursion>)  on [RecordEditor ID:isc_AdvancedListGrid_RenameableListGrid_0$31t] @ ISC_Grids.js:3212:138
        Layout.layoutChildren(<no args: recursion>)  on[ListGrid ID:isc_AdvancedListGrid_RenameableListGrid_0] @ ISC_Foundation.js:327:306
        ListGrid.layoutChildren(<no args: recursion>)  on[ListGrid ID:isc_AdvancedListGrid_RenameableListGrid_0] @ ISC_Grids.js:1291:32
        ListGrid.setFields(_1=>Array[44]) on[ListGrid ID:isc_AdvancedListGrid_RenameableListGrid_0] @ ISC_Grids.js:1201:6
        ListGrid.refreshFields() on[ListGrid ID:isc_AdvancedListGrid_RenameableListGrid_0] @ ISC_Grids.js:1253:179
        ListGrid.setFieldState(_1=>Array[43]) on[ListGrid ID:isc_AdvancedListGrid_RenameableListGrid_0] @ ISC_Grids.js:1221:47
        ListGrid.setViewState(_1=>Obj) on[ListGrid ID:isc_AdvancedListGrid_RenameableListGrid_0] @ ISC_Grids.js:1249:49
        ListGrid.setShowFilterEditor(_1=>true) on[ListGrid ID:isc_AdvancedListGrid_RenameableListGrid_0] @ ISC_Grids.js:1848:87
        Class.setProperties() on[ListGrid ID:isc_AdvancedListGrid_RenameableListGrid_0] @ ISC_Core.js:328:109
        Class.setProperty(_1=>"showFilterEditor", _2=>true) on[ListGrid ID:isc_AdvancedListGrid_RenameableListGrid_0] @ ISC_Core.js:327:1296
        undefined.setProperty_15_g$(property_0_g$=>"showFilterEditor", value_0_g$=>true) @ 2DFD9D68A04A2CC542BC33C25C25793E.cache.js:104791:15
        undefined.setAttribute_54_g$(attribute_0_g$=>"showFilterEditor", value_0_g$=>true, allowPostCreate_0_g$=>true) @ 2DFD9D68A04A2CC542BC33C25C25793E.cache.js:104516:12
        undefined.setShowFilterEditor_0_g$(showFilterEditor_0_g$=>true) @ 2DFD9D68A04A2CC542BC33C25C25793E.cache.js:127723:8
        undefined.hideFilterBuilder_0_g$() @ 2DFD9D68A04A2CC542BC33C25C25793E.cache.js:327025:23
        undefined.toggleFilterBuilder_0_g$() @ 2DFD9D68A04A2CC542BC33C25C25793E.cache.js:327648:10
        undefined.onClick_399_g$(event_0_g$=>An event type) @ 2DFD9D68A04A2CC542BC33C25C25793E.cache.js:458857:24
        undefined.dispatch_240_g$(handler_0_g$=>net.pricefx.web.client.common.grid.AdvancedGrid$3@b0) @ 2DFD9D68A04A2CC542BC33C25C25793E.cache.js:214628:16
        undefined.dispatch_239_g$(handler_0_g$=>net.pricefx.web.client.common.grid.AdvancedGrid$3@b0) @ 2DFD9D68A04A2CC542BC33C25C25793E.cache.js:214624:8
        undefined.dispatch_0_g$(handler_0_g$=>net.pricefx.web.client.common.grid.AdvancedGrid$3@b0) @ 2DFD9D68A04A2CC542BC33C25C25793E.cache.js:38929:8
        dispatchEvent_2_g$(event_0_g$=>An event type, handler_0_g$=>net.pricefx.web.client.common.grid.AdvancedGrid$3@b0) @ 2DFD9D68A04A2CC542BC33C25C25793E.cache.js:41555:14
        undefined.doFire_0_g$(event_0_g$=>An event type, source_0_g$=>null) @ 2DFD9D68A04A2CC542BC33C25C25793E.cache.js:41799:9
        undefined.fireEvent_2_g$(event_0_g$=>An event type) @ 2DFD9D68A04A2CC542BC33C25C25793E.cache.js:41872:8
        undefined.fireEvent_1_g$(event_0_g$=>An event type) @ 2DFD9D68A04A2CC542BC33C25C25793E.cache.js:41677:24
        undefined.fireEvent_7_g$(event_0_g$=>An event type) @ 2DFD9D68A04A2CC542BC33C25C25793E.cache.js:61679:30
        <anonymous>(param_0_g$=>Obj) @ 2DFD9D68A04A2CC542BC33C25C25793E.cache.js:111313:16
        apply_1_g$(jsFunction_0_g$=>anonymous(), thisObj_0_g$=>[object Window], args_0_g$=>[object Arguments]) @ 2DFD9D68A04A2CC542BC33C25C25793E.cache.js:17841:28
        entry0_0_g$(jsFunction_0_g$=>anonymous(), thisObj_0_g$=>[object Window], args_0_g$=>[object Arguments]) @ 2DFD9D68A04A2CC542BC33C25C25793E.cache.js:17897:16
        <anonymous>() @ 2DFD9D68A04A2CC542BC33C25C25793E.cache.js:17877:14
        click() on [ImgButton ID:isc_ImgButton_217] @ 2DFD9D68A04A2CC542BC33C25C25793E.cache.js:111337:22
        StatefulCanvas.handleActivate(_1=>Obj, _2=>undef) on [ImgButton ID:isc_ImgButton_217] @ ISC_Foundation.js:211:108
        StatefulCanvas.handleClick(_1=>Obj, _2=>undef) on [ImgButton ID:isc_ImgButton_217] @ ISC_Foundation.js:212:13
        [c]EventHandler.bubbleEvent(_1=>[ImgButton ID:isc_ImgButton_217], _2=>"click", _3=>undef, _4=>undef, _5=>undef) on [Class EventHandler] @ ISC_Core.js:1704:89
        [c]EventHandler.handleClick(_1=>[ImgButton ID:isc_ImgButton_217], _2=>undef) on [Class EventHandler] @ ISC_Core.js:1562:50
        EventHandler._handleMouseUp(_1=>[object MouseEvent], _2=>undef) on [Class EventHandler] @ ISC_Core.js:1547:11
        [c]EventHandler.handleMouseUp(_1=>[object MouseEvent], _2=>undef) on [Class EventHandler] @ ISC_Core.js:1538:57
        [c]EventHandler.dispatch(_1=>[c]EventHandler.handleMouseUp(), _2=>[object MouseEvent]) on [Class EventHandler] @ ISC_Core.js:1782:108
        HTMLDocument.eval(event=>[object MouseEvent]) @ [no file]:3:123
    Last edited by lamr; 3 Oct 2016, 06:04.

    #2
    We're taking a look at the problem.

    In the meantime, the showFilterOperator behavior you describe is the new default UI - but you can switch it off with setShowFilterOperators(false), which should return you to the old UI and behavior. Let us know how you get on.

    Comment


      #3
      Thank you for looking into it!

      However I can't find setShowFilterOperators method on ListGrid or on any related class. Can you please point me where I can find it? I'm on 6.0p-2016-10-03.

      Also trying to set showFilterOperators attribute on ListGrid is a noop for me and does nothing.

      Thank you,
      Tomas

      Comment


        #4
        Apologies, the method is called setAllowFilterOperators() - it's in the doc

        Comment


          #5
          It works with the workaround. Thanks!
          However not sure how this will be accepted by users. Any information whether this could be addressed even for case when allowFilterOperators == true would be really appreciated.

          Thank you!
          T.

          Comment


            #6
            Yes, it's a bug, so it will be fixed.

            The problem is just that the inSet filter-operator needs both prefix and suffix symbols for its expression (surrounding brackets), where most only have a prefix, and we're not catering for that fully when converting between operator button and inline expression.

            We'll update here when it's been fixed.

            Comment

            Working...
            X