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

Lightning Component Picklist values duplicating (growing)
In a lightning component when I change value I am rendering values for different picklist. But the second picklist(prepay Buydown Years is adding values instead of re-rendering picklist values

When I change values in the field - Fixed_Rate_Period__c
I want to rerender picklist values. - Prepay_Buydown_Years__c
When I change values in the field - Fixed_Rate_Period__c
I want to rerender picklist values. - Prepay_Buydown_Years__c
<!-- Prepay Buydown Years --> <lightning:select disabled="{!v.isEdgeCase == true ? true : v.loanRecord.LLC_BI__Product__c != v.PermLoanString }" aura:id="PrepayBuydownYears" name="PrepayBuydownYears" label="Prepay Buydown Years" value="{!v.loanRecord.Prepay_Buydown_Years__c}" onchange="{!c.changeRefreshEvent}"> <option disabled="{!v.loanRecord.Prepay_Buydown_Years__c != null && v.loanRecord.Prepay_Buydown_Years__c != ''}" value="" selected="{!v.loanRecord.Prepay_Buydown_Years__c == null || v.loanRecord.Prepay_Buydown_Years__c == ''}" >--None--</option> <aura:iteration items="{!v.Prepay_Buydown_Years__c}" var="item"> <!-- Rebate --> <aura:if isTrue="{!v.loanRecord.Rebate_or_Buydown__c == 'Rebate'}"> <aura:if isTrue="{!v.loanRecord.Fixed_Rate_Period__c == '96month'}"> <aura:if isTrue="{!v.loanRecord.LLC_BI__Spread__c > 0}"> <aura:if isTrue="{!item.value < 4}"> <option text="{!item.label}" value="{!item.value}" selected="{!item.value == v.loanRecord.Prepay_Buydown_Years__c}"/> </aura:if> </aura:if> <aura:if isTrue="{!v.loanRecord.LLC_BI__Spread__c == 0}"> <aura:if isTrue="{!item.value < 5}"> <option text="{!item.label}" value="{!item.value}" selected="{!item.value == v.loanRecord.Prepay_Buydown_Years__c}"/> </aura:if> </aura:if> </aura:if> <aura:if isTrue="{!v.loanRecord.Fixed_Rate_Period__c == '36month' || v.loanRecord.Fixed_Rate_Period__c == '12month'}"> <aura:if isTrue="{!v.loanRecord.LLC_BI__Spread__c == 0}"> <aura:if isTrue="{!item.value < 3}"> <option text="{!item.label}" value="{!item.value}" selected="{!item.value == v.loanRecord.Prepay_Buydown_Years__c}"/> </aura:if> </aura:if> <aura:if isTrue="{!v.loanRecord.LLC_BI__Spread__c > 0}"> <aura:if isTrue="{!item.value < 2}"> <option text="{!item.label}" value="{!item.value}" selected="{!item.value == v.loanRecord.Prepay_Buydown_Years__c}"/> </aura:if> </aura:if> </aura:if> </aura:if> <!-- RateBuydown --> <aura:if isTrue="{!v.loanRecord.Rebate_or_Buydown__c == 'RateBuydown'}"> <aura:if isTrue="{!v.loanRecord.Fixed_Rate_Period__c == '36month' || v.loanRecord.Fixed_Rate_Period__c == '12month'}"> <aura:if isTrue="{!item.value < 3}"> <option text="{!item.label}" value="{!item.value}" selected="{!item.value == v.loanRecord.Prepay_Buydown_Years__c}"/> </aura:if> </aura:if> <aura:if isTrue="{!v.loanRecord.Fixed_Rate_Period__c == '96month'}"> <aura:if isTrue="{!item.value < 5}"> <option text="{!item.label}" value="{!item.value}" selected="{!item.value == v.loanRecord.Prepay_Buydown_Years__c}"/> </aura:if> </aura:if> </aura:if> </aura:iteration> </lightning:select> </div>Thanks for help
Any pointers on how to clear picklist option before loading
deprecated - https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/aura_compref_aura_renderIf.htm
any suggestions, please