1

i have bunch of lightning inputFields that i am using in iteration and one lightning input field which is outside of the itteration and aura:id for all the input fields are same. But when on click of button i try to iteration over all the input fields with "component.find('aura:id')" i am able to get only one field which is out side of the itteration.

This issue is coming only with spring '19. IT is working fine in winter release.

CODE :

<lightning:recordEditForm objectApiName="{!v.objectName}" recordTypeId="{!v.recordTypeId}">
    <lightning:layout multipleRows="true">
        <lightning:layoutItem padding="around-small" size="6" class="{!v.availabelRecordTypes.length > 1 ? '':'slds-hide'}">                
            <lightning:inputField aura:id="sObjectRecordTypeInputFieldForm" class="slds-hide" fieldName="RecordTypeId" value="{!v.selectedRecordType}"/>                
        </lightning:layoutItem>
        <aura:iteration aura:id="iteration" items="{!v.fieldDetails}" var="field">
            <lightning:layoutItem padding="around-small" size="6">
                <lightning:inputField aura:id="sObjectInputFieldForm" class="{!field.requiredClass}" fieldName="{!field.fieldName}" />                    
            </lightning:layoutItem>
        </aura:iteration>
    </lightning:layout>
</lightning:recordEditForm>

Click Event of button i am calling method which will loop through all the input fields

getFieldValue: function(component, event, helper) {
    var inputFieldValue, inputFields, isValid;
    inputFields = component.find("sObjectInputFieldForm");
    isValid = true;
    for (var i in inputFields) {            
        var fieldName = inputFields[i].get("v.fieldName");              
     }        
  }

Error i am getting is here : enter image description here

I have debug the code and find out that i am getting only one field in spring org where as i am getting list of fields in winter org.

Help me out!!!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.