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:
this is the code for reproduction:
Best regards
Simon
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:
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); } });
Simon
Comment