ui5-combobox: Add selectedComboBoxItem property/attribute
See original GitHub issueIs your feature request related to a problem? Please describe.
Currently it’s inconvenient to get the selected ui5-cb-item
, because there is no selectedComboBoxItem
prop/attribute as it is in e.g. the ui5-select
component.
Describe the solution you’d like
I would like to have a property that receives the selected item, which then can be accessed using the change
event.
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Scripting API: PropertyAttribute
A custom attributes can be hooked up with a custom PropertyDrawer class to control how a script variable with that attribute is shown...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In my experience the answer to that question is no, it is not the text that is important. Way more often then not the combo box is used to display a look up list of some kind where you present the names to the user but the application needs the ID’s of their selection. Eg <select id="cityselector" name="city"> <item value=1>New York</option> <item value=2>Brazil</option> </select>
The user is going to pick a city name, but the app needs the id to perform the next operation such as update the database, or to fetch all hospitals where cityId=2 etc.
Isn’t this the most common pattern for others? I agree with the original poster that this element is missing THE fundamental property. The combobox should either have a property called “selectedValue” which contains the values attribute of the selected item.
Or mayber better, a “selectedIndex” property which provides the index of the selected item.
or…both
These guys do a pretty good job, and they provide both. https://component.kitchen/elix/AutoCompleteComboBox
Should I start another thread to request the ability to set an item as selected. Maybe I am missing something but I set an item as selected=true and it had no effect on the control.
Closing the issue as it seems not relevant any more - Lukas and Vladi discussed and agreed the topic.