Announcement

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

    getValue of Combobox changes after opening pickList

    Hi there,

    We are using the Combobox with a optionDatasource.
    At some point we are displaying different objects in a combobox, which could be have the same name.

    In the example it's accounting, north as well as south have an suborganizationunit named accounting.
    If the user enters the site, the getValue() method returns the correct value, which was initially set.
    After opening the the picklist of the combobox smartclient changes the current selected object to the first object with the same label.
    But, it isn't so that smartclient cannot distinguish between the elements, when i open up the picklist again and select the second accounting (which was initially set) the correct value returns of getValue().

    The expected behaviour is, after opening the picklist without selecting a new value, the getValue() method should return the initial value (in this example "Accounting 5".

    I have tested this against the latest nightly SmartClient_v100p_2015-10-07_Pro with latest versions of firefox and chrome. In both cases it was reproducable.

    See here:
    Click image for larger version

Name:	Animation 14.gif
Views:	91
Size:	317.5 KB
ID:	231862

    this is the code for reproduction:
    Code:
    organizations = [{
            "nameAndNumberString" : "None ",
            "organitzationUnitsDistanceToRootField" : 0,
            "organizationUnitsNameField" : "None"
        }, {
            "nameAndNumberString" : "Root 1",
            "organitzationUnitsDistanceToRootField" : 0,
            "organizationUnitsNameField" : "Root"
        }, {
            "nameAndNumberString" : "North 2",
            "organitzationUnitsDistanceToRootField" : 1,
            "organizationUnitsNameField" : "North"
        }, {
            "nameAndNumberString" : "Accounting 4",
            "organitzationUnitsDistanceToRootField" : 2,
            "organizationUnitsNameField" : "Accounting"
        }, {
            "nameAndNumberString" : "South 3",
            "organitzationUnitsDistanceToRootField" : 1,
            "organizationUnitsNameField" : "South"
        }, {
            "nameAndNumberString" : "Accounting 5",
            "organitzationUnitsDistanceToRootField" : 2,
            "organizationUnitsNameField" : "Accounting"
        }
    ];
    isc.DynamicForm.create({
        "ID" : "assigmentForm",
        "width" : 200,
        "fields" :
        [{
                "ID" : "organizationUnitCombobox",
                "name" : "organizationUnitCombobox",
                "title" : "label",
                "type" : "text",
                "editorType" : "comboBox",
                "width" : 300,
                "readOnlyDisplay" : "static",
                "loadingDisplayValue" : null,
                "fetchDelay" : 500,
                "textMatchStyle" : "substring",
                "allowEmptyValue" : true,
                "displayField" : "organizationUnitsNameField",
                "valueField" : "nameAndNumberString",
                optionDataSource : isc.DataSource.create({
                    dataFormat : "json",
                    ID : "organizationDatasource",
                    clientOnly : true,
                    testData : organizations
                }),
                "pickListFields" :
                [{
                        "name" : "organitzationUnitsDistanceToRootField",
                        "type" : "integer",
                        "align" : "right",
                        "canEdit" : false,
                        "canSort" : false,
                        "showIf" : function (list, field, fieldNum) {
                            return false;
                        },
                        "showTitle" : false
                    }, {
                        "name" : "organizationUnitsNameField",
                        "type" : "text",
                        "width" : "100% ",
                        "formatCellValue" : function (value, record, rowNum, colNum) {
                            if (record != null && colNum == 0) {
                                var distanceToRoot = record.organitzationUnitsDistanceToRootField;
                                var indentedString = "";
                                while (distanceToRoot > 0) {
                                    indentedString += "  ";
                                    distanceToRoot--;
                                }
                                return indentedString + value;
                            } else {
                                return value;
                            }
                        },
                        "canEdit" : false,
                        "canSort" : false,
                        "showTitle" : false
                    }
                ],
                "pickListProperties" : {
                    "showHeader" : false
                }
            }
        ],
        "values" : {
            "organizationUnitCombobox" : "Accounting 5"
        }
    });
    isc.Button.create({
        title : "what is the selected value?",
        width : 200,
        top : 50,
        left : 50,
        click : function () {
            field = organizationUnitCombobox;
            fieldJson = {};
            fieldJson.value = field.getValue();
            fieldJson.displayValue = field.getDisplayValue();
            isc.say(JSON.stringify(fieldJson));
            console.log(fieldJson);
        }
    });
    Best regards
    Simon

    #2
    Duplicate display values like this are impossible to "fully" support in a field which supports freeform text entry -- a user could literally type into the field and move on and it would be ambiguous which value they were attempting to pick.
    But we agree this case should be handled if possible. We're taking a look

    Regards
    Isomorphic Software

    Comment


      #3
      Hi SimonF,

      what tool did you use in order to create that issue-demonstration?

      Best regards
      Blama

      Comment


        #4
        Blama
        I'm using ScreenToGif (https://screentogif.codeplex.com/). Very useful

        Isomorphic
        thanks, for the fast feedback - waiting for further resutls.

        Comment


          #5
          Ok - we've made a change we think should address this issue. Please try the next nightly build, dated Oct 10 or above.

          Regards
          Isomorphic Software

          Comment


            #6
            Thanks for the fix, but it doesn't seem to be fixed right.
            Now I cannot change the selection between the first Accounting to the second.
            If I change from the first Accounting to Root and back to second Accounting it works.
            Imho this is no better than before, isn't itī?

            Tested with the altest nightly SmartClient_v100p_2015-10-13_Pro

            see here: Click image for larger version

Name:	Animation 15.gif
Views:	82
Size:	272.2 KB
ID:	231970
            Last edited by SimonF; 13 Oct 2015, 08:39.

            Comment


              #7
              Ok - we have reworked the fix. Please try the *next* nightly build, Oct 14 or above and let us know if the problem persists for you.

              Regards
              Isomorphic Software

              Comment


                #8
                Thanks, the fix does work.

                Comment

                Working...
                X