Skip to Content
0
Jul 06, 2015 at 06:14 AM

MultiComboBox Set Selected Item by Text Instead of Key

1506 Views

Hi all,

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 selectedItems.

addSelectedKeys(aKeys) Adds selected items.

setSelectedItems(aItems) Setter for association selectedItems.

setSelectedKeys(sSelectedKeys) Setter for property selectedKeys.