Announcement

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

    showPicker method not called for SelectItems

    SmartClient Version: v10.1p_2016-02-11/Enterprise Development Only (built 2016-02-11)

    Chrome on OSX

    Hello, please modify the #formatRelatedValue sample like this:
    Code:
    isc.DynamicForm.create({
        items: [
            {
                name: "employeeName", title: "Employee",
                optionDataSource: "employees",
                valueField: "EmployeeId", displayField: "Name",
                showPicker: function () {
                    isc.logEcho('showPicker')
                    return this.Super("showPicker", arguments);
                },
                pickListFields: [
                    {name: "Name"},
                    {name: "Email"}
                ],
                width: 250, pickListWidth: 350,
                formatValue: function (value, record, form, item) {
                    var selectedRecord = item.getSelectedRecord();
                    if (selectedRecord != null) {
                        return selectedRecord.Name + " (" + selectedRecord.Email + ")";
                    } else {
                        return value;
                    }
                }
            },
            {
                name: "otherEmployeeName", title: "Employee", type: "comboBox",
                optionDataSource: "employees",
                valueField: "EmployeeId", displayField: "Name",
                showPicker: function () {
                    isc.logEcho('showPicker')
                    return this.Super("showPicker", arguments);
                },
                pickListFields: [
                    {name: "Name"},
                    {name: "Email"}
                ],
                width: 250, pickListWidth: 350,
                formatOnBlur: true,
                formatValue: function (value, record, form, item) {
                    var selectedRecord = item.getSelectedRecord();
                    if (selectedRecord != null) {
                        return selectedRecord.Name + " (" + selectedRecord.Email + ")";
                    } else {
                        return value;
                    }
                }
            }
        ]
    });
    You'll see that showPicker is called only for the comboBox, not for the select.
    Also, a call to form.getItem('otherEmployeeName').showPicker() works, while form.getItem('employeeName').showPicker() doesn't show the picker.

    #2
    Thanks for the test case. You're right that the SelectItem does not use showPicker() to show its pickList, and the documentation doesn't reflect this.
    We'll look at resolving this discrepancy, though this isn't something we'd consider an urgent bug.

    If you need a notification method when the user clicks a selectItem to show the pickList, you should be able to just use the click handler for the item.

    Regards
    Isomorphic Software

    Comment


      #3
      Originally posted by Isomorphic View Post

      If you need a notification method when the user clicks a selectItem to show the pickList, you should be able to just use the click handler for the item.
      thanks for your reply. Actually I need to show the picker when the user clicks the title or another icon.
      And I can't simply substitute the picker icon using pickerIconSrc due to spriting.
      Last edited by claudiobosticco; 14 Feb 2016, 06:54.

      Comment


        #4
        actually I've found that using a ComboBoxItem works for my use case on handset devices. Setting:
        Code:
        pickerSearchFormProperties: {visibility: "hidden"},
        pickerSaveButtonTitle: null
        gives the pickList an appearance similar to the SelectItem.

        Comment


          #5
          We've addressed the issue in SelectItem for builds dated February 28 and later - showPicker() will now fire as documented.

          Comment


            #6
            SmartClient Version: v10.1p_2016-02-28/Enterprise Deployment (built 2016-02-28)

            verified, thank you very much.

            Comment

            Working...
            X