Pages

▼

Tuesday, 19 December 2017

Selecting multiple values from a Picklist in Lightning Component


All the credit goes to below blog post -
https://www.soliantconsulting.com/blog/create-a-custom-salesforce-lightning-multiselect-component

As I am not able to get the result immediately and spent sometime to figure out few issues, I am posting my version which might help some of you.
Server Classes -
Custom Event to fire -
Reusable component -
Using the above component -

Hold the 'Shift' key to select the multiple values.

3 comments:

  1. Really great Info.. Very clear and detail info.Useful one
    Thanks for sharing..

    Salesforce Lightning Training



    ReplyDelete
  2. Selecting multiple values from a picklist in a Lightning Component requires a reusable component that can maintain the available options, track selected values, and communicate changes to other components. The example provides a custom multi-select implementation using server-side Apex classes, a custom Aura event, and a reusable Aura component. The server-side SelectItem class represents each option using label, value, and selected properties, while SampleClass provides sample values such as All, New, and Old.

    The custom SelectChange Aura event is used to notify other components when the selection changes. It exposes a values attribute containing the selected values, allowing the reusable component to communicate the user's selections through a defined component event. Developers working with interactive component behavior and client-side web technologies can also explore Javascript Course in Chennai.

    ReplyDelete
  3. The reusable component maintains attributes such as options, selectedItems, infoText, width, and dropdownLength, providing configurable behavior for the multi-select interface. By combining the Apex-provided options with component attributes and a selection-change event, the implementation provides a structured way to build a custom multiple-selection control. Those interested in developing related frontend skills can further explore Javascript Training in Chennai.

    ReplyDelete