You need to sign in to do that
Don't have an account?
Luciano Roberto
Add new item on picklist component Lightning
Folks,
I have a component that has a picklist that is populated through a query in Metadata.
I need to add one more line in the picklist.
Example:
PicklistName: A
B
C
These values are automatically filled in by the controller.
I need to include the list value: "--- Select -"
Would stay
PicklistName: - Select -
A
B
C
Thanks
I have a component that has a picklist that is populated through a query in Metadata.
I need to add one more line in the picklist.
Example:
PicklistName: A
B
C
These values are automatically filled in by the controller.
I need to include the list value: "--- Select -"
Would stay
PicklistName: - Select -
A
B
C
Thanks
Sandhya,
But I managed to solve it, in fact I just needed to include the tag:
<ui:inputSelectOption text="" label="-- Selecione --" />
The code looks like this, If someone needs to:
<!--Controller Field - Motivo 1-->
<lightning:layoutItem size="12" padding="around-small">
<lightning:select aura:id="Motivo1__c"
value="{!v.caseObj.Motivo1__c}"
name="motivo1"
label="Motivo 1"
onchange="{!c.onControllerFieldChange}">
<ui:inputSelectOption text="" label="-- Select --" />
<aura:iteration items="{!v.listMotivos1}" var="val">
<option value="{!val.MasterLabel}">{!val.DependentFieldTextPtBR__c}</option>
</aura:iteration>
</lightning:select>
</lightning:layoutItem>
All Answers
Check below link where you have some work around.
https://salesforce.stackexchange.com/questions/220088/how-to-populate-lightningselect-with-picklist-field-values
Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
Best Regards
Sandhya
Sandhya,
But I managed to solve it, in fact I just needed to include the tag:
<ui:inputSelectOption text="" label="-- Selecione --" />
The code looks like this, If someone needs to:
<!--Controller Field - Motivo 1-->
<lightning:layoutItem size="12" padding="around-small">
<lightning:select aura:id="Motivo1__c"
value="{!v.caseObj.Motivo1__c}"
name="motivo1"
label="Motivo 1"
onchange="{!c.onControllerFieldChange}">
<ui:inputSelectOption text="" label="-- Select --" />
<aura:iteration items="{!v.listMotivos1}" var="val">
<option value="{!val.MasterLabel}">{!val.DependentFieldTextPtBR__c}</option>
</aura:iteration>
</lightning:select>
</lightning:layoutItem>