Announcement

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

    pickList.selectionUpdated in SelectItem with multiple:true is called 3 times

    SmartClient Version: SNAPSHOT_v11.1d_2017-05-05/Enterprise Development Only (built 2017-05-05)

    Chrome on OSX

    Hello, please try this test case:

    Code:
    isc.DynamicForm.create({
        ID:"testForm",
        width: 500,
        fields : [
          {
            name: "multipleSelect", title: "Select all items", editorType: "SelectItem", 
            optionDataSource: "supplyItem",
            optionCriteria: {units:"Ream"},
            displayField:"SKU", valueField:"itemID",
            pickListWidth:400,
            pickListFields:[
                {name:"SKU"},
                {name:"itemName"}
            ],
            multiple: true,
            specialValues: { "**emptyValue**": "Select None", "**selectAllValues**": "Select All" },
            separateSpecialValues: true,
            pickListProperties: {
                    selectionUpdated: function (record, recordList) {
                        if (recordList.length > 6) {
                            this.selectRecord(record, false);
                        } else {
                          var hint = " " + recordList.length + "/6"
                          isc.logEcho(hint)
                          testForm.getItem("multipleSelect").setHint(hint);
                        }
                    }
                }
        }
      ]
    });
    open the pickList and try selecting a record: you'll see that the selectionUpdated method is called 3 times, and only in the first call the record is selected.

    #2
    These events are limited starting in the build of 5/10 or later.

    Comment


      #3
      SmartClient Version: SNAPSHOT_v11.1d_2017-05-10/Enterprise Development Only (built 2017-05-10)

      thanks, but now it seems that there's another problem with the test case.
      When you open the pickList and try to select a record, it passes one time in the 'else' (in selectionUpdated - its parameters have the correct values), but the record doesn't get selected.
      If you click a second time or another record, it gets selected.

      Comment


        #4
        Replace your setHint call with:
        Code:
        var item = testForm.getItem("multipleSelect");
        item.delayCall("setHint", [hint], 100);
        It appears that an item redraw is occurring before the control has had a chance to wrap up selection updates.

        Comment


          #5
          that did the trick, thank you very much!

          Comment

          Working...
          X