cancel
Showing results for 
Search instead for 
Did you mean: 

How to multiselect items in multi combo box ?

Former Member
0 Kudos

I have a chart in which I need to have two values under 'Dimension' be selected and one value under 'Measure' be selected.

Following is the code:

multicombobox1=for dimension

multicombobox2=for measure

for (var i = 0; i < ChartFields.length; i++) {

  if (ChartFields[i]["selected"] == true) {

            if (ChartFields[i]["type"] == dimension) {

                          multicombobox1.getselectedItems();

             aDimensions.push();

                               }

else if (ChartFields[i]["type"] == measure) {

             multicombobox1.getselectedItems();

             aMeasures.push();

}

chartfields is array[] of length 3..

array[0] -> A

array[1] -> B

array[2] -> C


This is selecting only 1 value out of 2 values from dimension from multicombobox1 and 1 value out of 1 from measure for multicombobox 2.

I think array is needed to hold dimension and measure values.. how to do that.. please help


how to select both values of dimension for chart??

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member203031
Contributor
0 Kudos

HI Abhi,

You can store the values in the array in the form of objects then you can able to see the values.

I think values are over riding in the array.

I am not sure.

former_member203031
Contributor
0 Kudos

Hi Abhi,

Please refer the following link:

SAPUI5 Explored

Thanks,

Deepak Raj.

Former Member
0 Kudos

Hi Abhi,

For MultiComboBox items set a key as shown below

<MultiComboBox id="multiCombo"  width="500px"

  items="{

                    path: '/ProductCollection',

                     sorter: { path: 'Name' }

                }">

  <core:Item key="{Name}" text="{Name}" />

  </MultiComboBox>

so when u fetch selectedKeys using the below code in controller

this.getView().byId("multiCombo").getSelectedKeys();

you will get list of selected dimensions.

Regards

Laxmi

SergioG_TX
Active Contributor
0 Kudos

check this example

SAPUI5 Explored