Announcement

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

    ComboBoxItem & showFilterEditor

    Hi,

    I'm trying to use a ComboBoxItem with the showFilterEditor property, but I'm getting some unexpected behaviour ...

    Here's the sample code (runs off the ISC web site "ComboBox & Family -> DropDown Grid" test bed):

    Code:
    isc.DynamicForm.create({
        ID:"exampleForm",
        width:300,
        fields: [
            {
                name:"itemID",
                editorType:"ComboBoxItem",
                width:240,
                title:"Item",
                optionDataSource:"supplyItem",
                valueField:"SKU",
                displayField:"itemName",
                pickListProperties : { showFilterEditor : true },
                pickListWidth:450,
                pickListFields: [
                    { name: "itemName" },
                    { name: "units" },
                    { name: "unitCost" }
                ]
            }
        ]
    });
    The problem is that when the user tries to click inside the "Filter Editor" the combo box closes.

    This works fine when using a regular SelectItem ... We need the combined behaviour ...

    Any ideas?

    Thanks,

    #2
    Anyone had a chance to look into this one?

    Thanks,

    Comment


      #3
      Sorry for the delay responding. We are investigating this and will follow up soon

      Regards
      Isomorphic Software

      Comment


        #4
        We've now made a change which should address this issue. Please try the next nightly build, dated April 31

        Regards
        Isomorphic Software

        Comment


          #5
          We're running SmartClient_v82p_2013-01-28 ... Could we have a patch for this ? We unfortunately
          can't afford the full regression testing effort that would be required to migrate to the latest 8.2p release.

          Thanks,

          Comment


            #6
            Hi Yan
            Here's some patch code you can drop into your application.
            Note that this should be removed if/when you upgrade to a more recent version of SmartClient

            Code:
            // Patch code to avoid issue whereby if a comboBoxItem
            // pickList shows a filterEditor, interacting with a
            // selectItem or ComboBoxItem picklist within that filter
            // editor would dismiss the main pickList. 
            if (window.isc && isc.ComboBoxItem) {
                isc.ComboBoxItem.addProperties({
                
                $20y : function () {
                    var pl = this.pickList;
                    if (!pl || !pl.isVisible()) return;
                    
                    var target = isc.EH.lastEvent.target;
                    if (!pl.contains(target, true) &&
                        (!pl.$314 || !pl.$314.contains(target, true)) &&
                        (!pl.filterEditor || pl.filterEditor.getEditForm() != target)
                       )
                    {
                        var hitInnerPickList = false;
                        if (pl.filterEditor) {
                            var innerPickLists = pl.filterEditor.getEditForm().getItems().getProperty("pickList");
                            for (var i = 0; i < innerPickLists.length; i++) {
                                if (innerPickLists[i] && innerPickLists[i].contains(target)) {
                                    hitInnerPickList = true;
                                    break;
                                }
                            }
                        }
                        if (!hitInnerPickList) {
                            pl.hide();
                        }
                    }
                    
                    if (!this.$43l) {
                        this.$43l = 
                          this.ns.Page.setEvent("mouseUp", this, isc.Page.FIRE_ONCE, "$20zClick");
                    }
                    if (!this.$43m) {
                        this.$43m = 
                          this.ns.Page.setEvent("dragStop", this, isc.Page.FIRE_ONCE, "$43n");
                    }
                },
                
                $84z : function () {
                    var pickList = this.pickList;
                    if (!pickList || !pickList.isVisible() || !pickList.isDrawn()) return false;
                    var EH = isc.EH, event = isc.EH.lastEvent;
                    if (   ( event.eventType == "selectionChange" && 
                             pickList.contains(isc.EH.mouseDownTarget()) )
                           ||
                (
                            (pickList.contains(event.target,true) ||
                             (pickList.filterEditor && pickList.filterEditor.getEditForm() == event.target)) 
                           )
                       ) 
                    {
                        return true;
                    }
                    return false;
                }
                });
            }
            Regards
            Isomorphic Software

            Comment


              #7
              Thanks, that seems to have fixed the issue I was having ... I do have a follow-up question though ...

              Prior to using the "showFilterEditor" property, I was solely using the single field filter and also used
              the getPickListFilterCriteria() function to customize some filtering ... Now that I turn ON showFilterEditor,
              changing those filter form fields seem to be bypassing my getPickListFilterCriteria() method.

              What method should I implement to provide similar custom filtering logic ?

              Another question I have is the following ... Within the same form, I have two (2) ComboBoxItem. For
              one of them I set picklistProperties = { showFilterEditor : true } and for the other, don't specify it. Somehow,
              both ComboBoxItem have the filter row up top ? Are they sharing it because they are on the same form ? How
              can I have one have the filter and not the other ?

              Thanks,
              Last edited by yavery; 6 May 2013, 12:20.

              Comment


                #8
                Code:
                Prior to using the "showFilterEditor" property, I was solely using the single field filter and also used
                the getPickListFilterCriteria() function to customize some filtering ... Now that I turn ON showFilterEditor,
                changing those filter form fields seem to be bypassing my getPickListFilterCriteria() method.
                The criteria created by getPickListFilterCriteria() should be applied to the pickList when it is shown.
                If you're showing a filterEditor on the pickList (or for any filtered grid actually), it will attempt to display the current criteria in the filter editor fields, allowing the user to edit it. Additional criteria that can't be displayed / edited should be combined with any edits the user does make when the user types in the filterEditor and hits the "filter" button.

                That is how things are designed anyway, and from some quick sanity checking, seem to be working as designed in the most recent codebase.
                It is possible that this area has been improved since the build you're using.

                Regardless, you should be able to intercept a filter event triggered from the filterEditor using the "filterEditorSubmit" notification method. This should allow you to build your own set of criteria and apply them to the grid.

                Code:
                Another question I have is the following ... Within the same form, I have two (2) ComboBoxItem. For
                one of them I set picklistProperties = { showFilterEditor : true } and for the other, don't specify it. Somehow,
                both ComboBoxItem have the filter row up top ? Are they sharing it because they are on the same form ? How
                can I have one have the filter and not the other ?
                SelectItems and ComboBoxItems share pickLists by default. This was done to avoid calling "fetch" multiple times against the same dataSource with the same criteria when you have several of these items in your app with the same optionDataSource.
                In some cases this reuse is too agressive. We've hit various cases of this in the past, though typically if you have explicit "pickListProperties" defined we automatically build a separate pickList for the item in question.
                You can explicitly control this by setting "cachePickListResults" to false on your item.

                Regards
                Isomorphic Software

                Comment

                Working...
                X