Everything I have read online so far suggests that one must manually declare picklist (option) values when creating a lightning:select
component in an Lightning application. For us, this is less than ideal.
Before I throw in the towel on this idea, I thought I'd ask Stack Exchange. Is it possible yet to have a lightning:select
component automatically populate with options declared in the bound field's picklist values?
Best Answer
The basic method today is to get the values from the server, then render the values with $A.createComponents.
If that's too complicated, then you might consider using
lightning:inputField
, which is designed to work withlightning:recordEditForm
.There's no way to get
lightning:select
automatically populate with the options when bound to a field.