You need to sign in to do that
Don't have an account?

passing list of users into a picklist and display in Lightning Component
The Picklist field is visible but users are not visible and I am not able to select the users.
Apex Class:
Component:
Controller.js
Please help me from this issue.
Thanks and Regards,
Azar.
Apex Class:
public static List<String> getPickListValuesIntoList(){ List<String> pickListValuesList = new List<String>(); List<User> us = [Select id, name, MobilePhone, Email, IsActive from User Where IsActive = true]; for( User usr : us){ pickListValuesList.add(usr.name); } return pickListValuesList; }
Component:
<aura:attribute name="picklistValues" type="String[]" /> <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> <lightning:combobox name="general" label="Select User" placeholder="Choose User…" value="{!v.User.Name}" options="{!v.picklistValues}" onchange="{!c.doInit}"/>
Controller.js
doInit: function (component, event, helper) { var action = component.get("c.getPickListValuesIntoList"); action.setCallback(this, function(response){ var state = response.getState(); if (state === "SUCCESS") { var listItems = response.getReturnValue(); component.set("v.picklistValues", listItems); } }); $A.enqueueAction(action); }
Please help me from this issue.
Thanks and Regards,
Azar.
See this post for sample code