0

Lightning Ui namespace is deprecating soon hence we are migrating Ui namespace tags to the lightning namespace. We have used the below tag to select multi picklist values with the Ui namespace. Now salesforce suggesting to use Use lightning:select or lightning:combobox .

If we use lightning:select or lightning:combobox not able to select multiple picklist values. Could anyone please help me with this?

I have tried using multiple="true"​​​​​​​ in the lightning select tag but is not accepting.

<ui:inputSelect multiple="true" class="multiple" aura:id="InputSelectMultiple" change="{!c.onMultiSelectChange}">
        <ui:inputSelectOption text="Any"/>
        <ui:inputSelectOption text="Open"/>
        <ui:inputSelectOption text="Closed"/>
        <ui:inputSelectOption text="Closed Won"/>
 </ui:inputSelect>

Thanks, Anil Kumar

2
1

Neither of lightning:select or lightning:combobox support multiple select (as per docs). Lightning:dualListBox is the appropriate component for this-

https://developer.salesforce.com/docs/component-library/bundle/lightning:dualListbox/example

3
  • Hi Nagen, Thanks for the reply. Client is asking not to use duallistbox since they expecting same look and feel of ui:inputSelect. Do we have any other option.
    – Anil Kumar
    Oct 20 '20 at 9:13
  • I don't any of the base components can help you then. You can always build a custom component using the Lightning design system combo-box [blueprint] (lightningdesignsystem.com/components/combobox/…) . There's an example i found - cafeforce.com/…
    – Nagen Sahu
    Oct 20 '20 at 9:21
  • Thank you Nagen...
    – Anil Kumar
    Oct 20 '20 at 9:38
0

You should use the lightning:dualListbox, See the excerpts from the docs:

lightning:combobox

lightning:combobox is an input element that enables single selection from a list of options. The result of the selection is stored as the value of the input. Multiple selection is currently not supported. To support multiple selection, use lightning:dualListbox instead.

lightning:select

A lightning:select component creates an HTML select element. This component uses HTML option elements to create options in the dropdown list, enabling you to select a single option from the list. Multiple selection is currently not supported. To support multiple selection, use lightning:dualListbox instead.

If you want to create a similar UI as Combobox, then consider building your own custom component.

Also, note that Aura Components in the ui Namespace Are Deprecated

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.