You need to sign in to do that
Don't have an account?
Anu Singh 40
How Can I select different value in a picklist where picklist is in aura Iteration
Hi All
I m new to salesforce I want to select different values from a picklist where picklist is in aura iteration. It shows Only one selected value in all picklist from aura iteration.
here is the code
<aura:iteration items="{!v.Leadoptions}" var="fieldname">
<tr> <td class="slds-line-height_reset">
<div>{!fieldname}</div>
</td>
<td class="slds-line-height_reset">
<lightning:select name="opportunity" label="" aura:id="onjId" value="{!v.OppselectedValue}" onchange="{!c.changeAction}">
<option value="">None</option>
<aura:iteration items="{!v.Opportunityoptions}" var="oppname">
<option value="{!oppname}" text="{!oppname}"/>
</aura:iteration>
</lightning:select>
</td>
</tr>
</aura:iteration>
I m new to salesforce I want to select different values from a picklist where picklist is in aura iteration. It shows Only one selected value in all picklist from aura iteration.
here is the code
<aura:iteration items="{!v.Leadoptions}" var="fieldname">
<tr> <td class="slds-line-height_reset">
<div>{!fieldname}</div>
</td>
<td class="slds-line-height_reset">
<lightning:select name="opportunity" label="" aura:id="onjId" value="{!v.OppselectedValue}" onchange="{!c.changeAction}">
<option value="">None</option>
<aura:iteration items="{!v.Opportunityoptions}" var="oppname">
<option value="{!oppname}" text="{!oppname}"/>
</aura:iteration>
</lightning:select>
</td>
</tr>
</aura:iteration>
Please check out below sample code for your understanding and try to fit in with your requirement:
PicklistApexController can be implemented like below:
Now, you can create a service component which helps you display the values which were retrieved from the Apex:
js controller for this service component would be like below:
Hope above information helps. Please mark as Best Answer so that it can help others in future.
Thanks.