Announcement

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

    filterOperators not usable when filterEditorType:ComboBoxItem

    Hi,
    Here is slightly modified showcase sample http://www.smartclient.com/#inlineOperatorFilter :
    Code:
    isc.ListGrid.create({
        ID: "countryList",
        width:500, height:300, alternateRecordStyles:true,
        dataSource: worldDS,
        fields:[
            {name:"countryCode", width:50},
            {name:"countryName"},
            {name:"capital"},
            {name:"continent", [B]filterEditorType:ComboBoxItem[/B]},
            {name:"area"},
            {name:"population"}
        ],
        autoFetchData: true,
        showFilterEditor: true,
        allowFilterOperators: true,
        initialCriteria: { _constructor: "AdvancedCriteria", operator: "and",
            criteria: [
                { fieldName: "countryName", operator: "iNotContains", value: "i" },
                { fieldName: "capital", operator: "iNotStartsWith", value: "p" }
            ]
        }
    });
    Continent ListGridField has now set explicit ComboBoxItem as row filter editor.
    Context menu of this field has got "Filter using" option which defaults to "startWith" (ComboBoxItem default).
    The problem is that although you may change operator and it is correctly indicated:
    Click image for larger version

Name:	filterOperators.png
Views:	111
Size:	101.5 KB
ID:	238400

    It is completely ignored and filtering by "startWith" is made. Also showing context menu again proves that operator is not changed to "equals" - the one chosen last time.
    All above can be verified in online showcase using "Try it".
    Thanks,
    MichalG

    #2
    Hi michalg,

    please try with "" around the ComboBoxItem. I don't know if that's the reason, but this seems not to be correct compared to e.g.this sample.

    Best regards
    Blama

    Comment


      #3
      Hi Blama,
      Surrounding with "" is probably a "more" correct way, but anyway it does not make any change here. But thanks!
      I also noticed that if using TextItem instead of ComboBoxItem then it all works. Unfortunately I need to be able choose options but also write part of string in filter editor, so I really need ComboBox.
      MichalG

      Comment


        #4
        So, can we have ComboBoxItem as grid's field filter editor and still use filterOperators for this column?
        The field is type of text with valueMap or optionDataSource set.
        Thanks,
        MichalG

        Comment


          #5
          Just to keep you informed - we are looking at this. There are some wrinkles around how comboboxItems should behave in conjunction with explicitly chosen operators but we should be able to support the pattern in general.
          We will be following up with more information when we have it.

          Comment


            #6
            Hi,
            Is there anything new to follow up this issue?
            Thanks,
            MichalG

            Comment


              #7
              Sorry for the delay. We have the proposed behavior spec'd out and assigned to be implemented but it's not yet reached the top of the priority stack.

              To give you the full story: When a comboBoxItem is used as a filter control, there are two "filters" in play. The user can type a string which is used to filter the results in the drop-down set of options, and the user can either type a string or select a value from the list and use that to create criteria to apply to the target along with other values from the form.

              When the user types a partial value into the text box, the pickListFilterOperator is used to filter the pickList.

              When the user selects an item from the pickList and filters the grid, the standard FormItem behavior kicks in, meaning we can respect the chosen operator type.
              For an addUnknownValues:false ComboBoxItem, the user can't enter a value in the text box that doesn't match up with an entry in the drop-down. This means the behavior is
              - the user enters a partial value to filter down the set of options in the drop down
              - user selects an option (or types it to completion) and hits filter
              - the grid is filtered, using whichever operator makes sense (possibly using a "Not equal" to operator or similar).
              So the edge case is what happens if addUnknownValues is true and the user typed a value that doesn't match any entries in the drop-down (a partial value, say), and then hits enter to filter the grid as a whole.

              Currently in this situation the "PickListFilterOperator" is applied to the grid as a whole, ignoring what the user chose as an operator.
              This makes some sense as a default (it gives consistency between the entries displayed in the pick-list and the grid as a whole) but doesn't make sense to override an explicitly chosen operator.

              Therefore we'll be modifying this to respect the chosen operator when filtering the grid as a whole in this circumstance.

              We don't have a concrete schedule for getting this resolved but we anticipate it won't be more than a couple of weeks. We'll follow up when it gets checked in.


              Regards
              Isomorphic Software

              Comment


                #8
                Thanks for the explanation.
                MichalG

                Comment


                  #9
                  We've just got a change into the 11.1d branch to address this issue. It will be present in the next nightly build (September 13 or above)
                  Regards
                  Isomorphic Software

                  Comment


                    #10
                    Almost done. Still not good if you change the default ListGridField operator as in the following example:
                    Code:
                    isc.ListGrid.create({
                        ID: "countryList",
                        width:500, height:300, alternateRecordStyles:true,
                        dataSource: worldDS,
                        fields:[
                            {name:"countryCode", width:50},
                            {name:"countryName"},
                            {name:"capital"},
                            {name:"continent", [B]filterEditorType:ComboBoxItem, filterOperator:"iContains"[/B]},
                            {name:"area"},
                            {name:"population"}
                        ],
                        autoFetchData: true,
                        showFilterEditor: true,
                        allowFilterOperators: true,
                        initialCriteria: { _constructor: "AdvancedCriteria", operator: "and",
                            criteria: [
                                { fieldName: "countryName", operator: "iNotContains", value: "i" },
                                { fieldName: "capital", operator: "iNotStartsWith", value: "p" }
                            ]
                        }
                    });
                    Tested against http://www.smartclient.com/smartclie...OperatorFilter
                    Version 11.0p 2016-10-12
                    Thanks,
                    MichalG

                    Comment


                      #11
                      Hi MichalG,

                      Isomorphic's changes are in 11.1d, you tested 11.0p.

                      Best regards
                      Blama

                      Comment


                        #12
                        Hi Blama,
                        Right, but the main issue seems to be fixed in 11.0p, so I assumed that fix has been applied in production version, too.
                        I also checked 11.1d jars in our SGWT application - the same behavior - works now, but as long as ListGridField.setFilterOperator() is not used.
                        MichalG

                        Comment


                          #13
                          Hi MichalG,
                          Can you clarify exactly what steps you're taking with the above code, what you're expecting to see and what's actually happening for you?
                          In our testing this appears to be working as expected now

                          Regards
                          Isomorphic Software

                          Comment


                            #14
                            Sorry- more detailed description:
                            This code is already fixed:
                            Code:
                            isc.ListGrid.create({
                                ID: "countryList",
                                width:500, height:300, alternateRecordStyles:true,
                                dataSource: worldDS,
                                fields:[
                                    {name:"countryCode", width:50},
                                    {name:"countryName"},
                                    {name:"capital"},
                                    {name:"continent",[B] filterEditorType:ComboBoxItem[/B]},
                                    {name:"area"},
                                    {name:"population"}
                                ],
                                autoFetchData: true,
                                showFilterEditor: true,
                                allowFilterOperators: true,
                                initialCriteria: { _constructor: "AdvancedCriteria", operator: "and",
                                    criteria: [
                                        { fieldName: "countryName", operator: "iNotContains", value: "i" },
                                        { fieldName: "capital", operator: "iNotStartsWith", value: "p" }
                                    ]
                                }
                            });
                            This one (edge case when ListGridField.filterOperator is also set) has still the issue:
                            Code:
                            isc.ListGrid.create({
                                ID: "countryList",
                                width:500, height:300, alternateRecordStyles:true,
                                dataSource: worldDS,
                                fields:[
                                    {name:"countryCode", width:50},
                                    {name:"countryName"},
                                    {name:"capital"},
                                    {name:"continent", filterEditorType:ComboBoxItem, [B]filterOperator:"iContains"[/B]},
                                    {name:"area"},
                                    {name:"population"}
                                ],
                                autoFetchData: true,
                                showFilterEditor: true,
                                allowFilterOperators: true,
                                initialCriteria: { _constructor: "AdvancedCriteria", operator: "and",
                                    criteria: [
                                        { fieldName: "countryName", operator: "iNotContains", value: "i" },
                                        { fieldName: "capital", operator: "iNotStartsWith", value: "p" }
                                    ]
                                }
                            });
                            To reproduce:
                            Right click Continent column filter and change operator from "contains" (the default set via filterOperator:"iContains") to some other - "starts with" has been choosen on pic below: Click image for larger version

Name:	filterOperator0.png
Views:	98
Size:	37.6 KB
ID:	240743


                            The right operator icon is then shown in the filter field, but if you click it you will see that "contains" is still marked instead of "starts with": Click image for larger version

Name:	filterOperator1.png
Views:	79
Size:	37.8 KB
ID:	240744

                            Hope this is clear now.
                            Thanks,
                            MichalG
                            Tested in SmartClient Version 11.0p (2016-10-12)
                            Last edited by michalg; 13 Oct 2016, 00:44. Reason: SmartClient version added.

                            Comment

                            Working...
                            X