You need to sign in to do that
Don't have an account?
Sabrent
Can some one please check my coode and tell me why my picklist in the lightning cmponent is not populating with anu values?
Basiclaly on my lightning component I want a picklist of Users.
Thanks !
Passing List of Users to a picklist and displaying it in lightning component
<aura:component controller = "EmailViewController"> <aura:attribute name="userList" type="User[]"/> <aura:handler name="init" value="{!this}" action="{!c.pickUser}"/> <lightning:combobox name="general" label="Many Options" placeholder="Select a User Option" options{!v.userList}" onchange="{! c.pickUser}"/> </aura:component> <.JS controller> pickUser: function (component, event, helper) { var action = component.get("c.getUsers"); action.setCallback(this, function(response){ var state = response.getState(); if (state === "SUCCESS") { var listItems = response.getReturnValue(); component.set("v.userList", listItems); } }); $A.enqueueAction(action); } <Apex Controller> @AuraEnabled public static List<User> getUsers() { List<User> lstUsers = [SELECT Id,FirstName,LastName FROM User]; return lstUsers; }
Can some one please check my coode and tell me why my picklist in the lightning cmponent is not populating with anu values?
Basiclaly on my lightning component I want a picklist of Users.
Thanks !
That's the reason i just returned the list as is, instead of converting it to list of string, and returning that instead.