I am experiencing difficulties updating the label of a selected option in a Dojo-created select field, despite having a form to 'rename' the selected option.
Various methods have been attempted:
var selectDropdown = registry.byId("stateSelect");
selectDropdown.updateOption({
value : currentId, // the existing ID to update
label : this.new_name
});
selectDropdown.reset();
However, the above code does not successfully change the label.
selectDropdown.set("displayedValue", this.new_name);
selectDropdown.reset();
The alternative method described above also fails to update the label, even though:
selectDropdown.get("displayedValue");
Returns the old label that I am attempting to alter.
edit: Here is how the Select field is created and populated with items...
var select = new Select({
name : "stateSelect",
}, "stateSelect");
select.addOption({
value : 0,
label : "test"});