Select Element getValue() should get object when options is populated with Objects (Enhancement)
reynardmc22 opened this issue · 1 comments
reynardmc22 commented
There doesn't appear to be a way to access the Object in Options if it's populated with a list of Object thru the API. It would seem to make sense that getValue() return the object instead of the text value of the Object. Or have an API method to getOption(value) or getSelectedOption or whatever name would make the most sense.
mkozhukh commented
For richselect, combo and similar controls you can use the next code to access the selected object
var value = combo.getValue();
var obj = combo.getList().getItem(value);
For the "select" control, there is no easy way to obtain the original object. We will consider extending getValue API ( default behavior will not change, getValue will return the selected value by default )