Good day everyone,
I am using a sap.m.multicombobox in a view. The list of items that I bind to the multicombobox includes both enabled and disabled items. I would like all items to be shown when opening the control, and the disabled items not be selectable.
The specific use case that I need to solve is that items can be disabled in another part of the application, but if a previous record had a selection that was since disabled, it still needs to show up in the combobox, disabled in this case just means that users can't select it going forward.
view.js
var oTypeTemplate = new sap.ui.core.Item({ key: "{TypeID}", text: "{Type}", enabled: "{Enabled}" }); var oTypeInput = new sap.m.MultiComboBox("cboTypes", { placeholder: "Select Types", items: { path: "/Record/Types/items", template: oTypeTemplate }, selectedKeys: { path: "/Record/Types/selected", template: oTypeTemplate }, selectionFinish: controller.handleFailureTypeSelection });
The multicombobox binds the items correctly, however it disregards the disabled items entirely. thet are not part of the select list, and keys that are disabled are not selected.
I do the exact same thing with a regular combobox in the same view, and it works as expected.
Am I missing something?
Any advice is appreciated.
Thanks,
Allan Irvine