Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Salesforce
  3. Question
Salesforce

How do I effectively develop a lightning combo box?

Asked by Abigail Abraham Sep 23, 2022 2.1K views 1 answer
Share

About this question

I'm developing a lightning web component and I want to fill or populate my combobox from the result of the apex method so that I can in the html file get the result from the JavaScript file and put them in the combobox.


Template:

             name="Role"
            label="Role Name"
            value={value}
            placeholder=""
            options={rolesList.data.values}
            onchange={handleChange} >
            

javascript file:

import { LightningElement, track, wire} from 'lwc';
import getRoles from '@salesforce/apex/LeaveSettingsController.getRoles';
@wire(getRoles)
    rolesList;

Your answer

1 Answer

More Salesforce discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Salesforce Blogs

Guides, tips and career advice on Salesforce from JanBask experts.