MultiComboBox Set Selected Item by Text Instead of Key
I am quite new to UI5,
I have a developed
- 4 drop downs, mix of sap.m.ComboBoxes and sap.m.MultiComboBoxes.
- Integrated them with Odata services
- Based on item selected in first drop down, the underneath drop down will be mapped with new Odata
- All items are mapped with keys which are consumed from Odata service
- I am able to save it in the backend
- Everything works fine
The problem is the final bottom sap.m.MultiComboBox drop down doesn't have keys mapped from the Odata service, so keys are empty.
So, I am saving selected item text in the back end.
Now I would like to know if i can make an Multicombo box item selected using Text instead of Key ?
I have gone through all methods, it has methods to make an item selected using Key only.
Please guide me. Below Sap.m.MultiComboBox methods are not helping me.
addSelectedItem(oItem) Adds some item
oItem to the association named
addSelectedKeys(aKeys) Adds selected items.
setSelectedItems(aItems) Setter for association
setSelectedKeys(sSelectedKeys) Setter for property
Maksim Rashchynski replied
i am kind of lost what exactly is the problem?
sap.ui.core.Item has text and key , if there is no key, bind key with the same value as text