MultiSelect
Finds options by typing and keeps multiple selections.
When to use
- Choose several values from a limited list such as warehouse filters.
Examples
Choose delivery channels
Loading the example
<k:MultiSelect label="Delivery channels" change=".onChange">
<core:Item key="pickup" text="Pickup"/>
<core:Item key="carrier" text="Carrier"/>
</k:MultiSelect>sap.ui.define(["sap/ui/core/mvc/Controller", "kor/ui/Toast"], (Controller, Toast) => Controller.extend("sample.MultiSelectChange", {
onChange(event) {
const field = event.getSource();
const keys = event.getParameter("keys");
const labels = field.getItems().filter((item) => keys.includes(item.getKey())).map((item) => item.getText());
Toast.show(labels.join(", ") || "Selection cleared");
}
}));Choose warehouses
Selected entries remain visible while you search for more.
Loading the example
<k:MultiSelect label="Warehouses" placeholder="Type a warehouse name" items="{path: '/options', templateShareable: false}" change=".onChange">
<core:Item key="{key}" text="{text}"/>
</k:MultiSelect>sap.ui.define(["sap/ui/core/mvc/Controller", "kor/ui/Toast"], (Controller, Toast) => Controller.extend("sample.MultiSelectChange", {
onChange(event) {
const field = event.getSource();
const keys = event.getParameter("keys");
const labels = field.getItems().filter((item) => keys.includes(item.getKey())).map((item) => item.getText());
Toast.show(labels.join(", ") || "Selection cleared");
}
}));API
Properties
| Name | Type | Default | Description |
|---|---|---|---|
selectedKeys | string[] | [] | Keys of selected options |
label | string | Field label | |
placeholder | string | Placeholder | |
help | string | Supporting text | |
error | string | Validation message | |
required | boolean | false | Whether a selection is required |
enabled | boolean | true | Whether the field can be used |
Aggregations
| Name | Type | Description |
|---|---|---|
items | sap.ui.core.Item[] | Available options |
Events
| Name | Type | Description |
|---|---|---|
change | keys: string[] | Selection changed |