Announcement

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

    ComboBoxItem changeOnKeypress

    I am currently using a ComboBoxItem in order to allow the user to filter through a long dropdown list. Then we added the functionality "addUknownValues". My problem with this is before we had this logic, we would have a trigger on the combobox so that when the values change, it does a server call - this was on change using the picklist. Now it calls changed() when the user types into the combo-box - so I thought if I set changeOnKeypress to false that this would not happen - it doesnt - but now it also does not filter the current list when typing. How do I get around this? If it is possible?

    Code:
    isc.DynamicForm.create({
        width: 500,
        numCols: 4,
        fields : [{
            name: "bugStatus", title: "Bug Status", addUnknowValues:true,
            editorType: "comboBox",
    changed: function(){
    isc.warn('changed called');this.Super('changed');
    },
            valueMap : {
                "new" : "New",
                "active" : "Active",
                "revisit" : "Revisit",
                "fixed" : "Fixed",
                "delivered" : "Delivered",
                "resolved" : "Resolved",
                "reopened" : "Reopened"
            }
        },{
            name: "itemName", title: "Item Name", editorType: "comboBox", 
            optionDataSource: "supplyItem", pickListWidth: 250
        }]
    });

    #2
    So, you want to do some work (server trip, or whatever else) when the value changes, but only if the actual selected item in the list changes, right? And not just because the user is typing in order to filter the list?

    We may look deeper into this but this code below, in conjunction with leaving changeOnKeypress: true, should give you that for now, in the case of the valueMap-based item:

    changed: function(form, item, value) {
    if (this.valueMap[value.toLowerCase()]) {
    isc.warn('Do potentially focus-interrupting work in here');
    }
    },

    There was also a typo in "addUnknowValues" (missing 'n'), and there's no need to call Super() in changed() handlers.

    Let us know if this doesn't give you what you need.
    Last edited by Isomorphic; 7 May 2012, 22:15.

    Comment


      #3
      I think this is sufficient. Thanks

      Comment

      Working...
      X