Skip to Content

Multicombox is not displaying tokens when value is selected from it.

Hi all,

I have one array of data and I want to bind that data to multicombobox.

I have binded that data to Multicombobox using javascript as shown below.

The problem is when I select any value from multicombobox, tokens are not displaying as per the default behavior of the control.

Please help me in this. As per my guess, this array is not associative array (do not have keys and values.) this might have caused this issue.


XML view:
<MultiComboBox id="MCBId" width="280px" class="sapUiTinyMarginTop" ></MultiComboBox>

Controller code:
var data = sap.ui.getCore().getModel("myModel").getData();
       var oModel = new sap.ui.model.json.JSONModel();
        this.getView().setModel(oModel, "myModel");

       var fruitsArray = data.fruits[0].names;
        for(var i = 0; i<fruitsArray.length; i++){
           var fruitsDD;
           fruitsDD = this.getView().byId("MCBId");
          var oCoreItem = new sap.ui.core.Item();

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers