Skip to Content
author's profile photo Former Member
Former Member

How to multiselect items in multi combo box ?

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??

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Jun 28, 2016 at 06:33 PM

    check this example

    SAPUI5 Explored

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 29, 2016 at 06:26 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 29, 2016 at 07:12 AM

    Hi Abhi,

    Please refer the following link:

    SAPUI5 Explored

    Thanks,

    Deepak Raj.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 29, 2016 at 07:14 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.