Skip to Content

Disable some items in MultiComboBox

Dec 04, 2017 at 12:54 PM


avatar image

Hi everyone,

I have a MultiComboBox in which I want to disable some items. I have seen this example and also this one but both are for a ComboBox.

The problem is when I try the same thing, the items which are supposed to be disabled, disappear completely from the MultiComboBox (are invisible and not grayed out).

My guess is this is the default behavior in UI5. but does anyone know if I can make it work somehow?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Dennis Seah
Dec 06, 2017 at 01:12 AM

Hi Mahnaz

We cannot tell because we do not have visibility on what you have implemented.

here is another example,output

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Thanks Deniss for your reply. As I have referred in my description, the example you provided works for a ComboBox and not a MultiComboBox.

let's assume a basic scenario: we want all of our items of the MultiComboBox to be disabled by default and later in the code we enable them. so I guess we would do something like this in XML file:

however, this makes all the items disappear but I simply want them to be grayed out.

<MultiComboBox width="190px"
<core:Item key="{chartModel>name}" text="{chartModel>name}" enabled="false"/>

If you change sap.m.Select in your example to sap.m.MultiComboBox, you see that the first item is disappeared then.


Hi Mahnaz

after reading the code,

it is clear the mutlicombobox does not show disabled item.



Arjun Biswas Dec 05, 2017 at 04:05 AM

Hi ,

For enabling, you can use the setEnabled method and for hinding the items, you can use the setVisible method for your item object.

In your view use the foll. code :

				path: '/Your_Entity_Set_Name',
				sorter: { path: 'Your_field_name' }
			<core:Item key="{Your_field_name}" text="{Your_field_name}" />

Now in your controller in the on init method, you can implement the foll. code :

//here get all your list items and use the setEnabled method or the setVisible method for your required item.

Hope this helps,


Arjun Biswas.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

This does not work since sap.ui.core.Item does not have any method or property to set the visibility.
as I said, setEnabled (false) removes the item from the MultiComboBox.
I need a way to gray out the items.