function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Lightning PracticeLightning Practice 

How to use force:inputfield in aura:iteration?

Hi All,
How to use force:inputfield in aura:iteration?

<aura:iteration items="{!v.Accounts}" var="item">
{!item.Name}, {!item.Industry}
<br/>
</aura:iteration>
?
Thanks,
Ram.
Raj VakatiRaj Vakati
Force:input filed is not worked with iteration.Use the below code
 
<aura:component controller="ContactController" implements="force:appHostable,flexipage:availableForAllPageTypes">
    <aura:attribute name="contact" type="Contact[]"  
                    />
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
    <aura:iteration items="{!v.contact}" var="item">
        
        <lightning:input value="{!item.Name}"/>
        
    </aura:iteration>
</aura:component>



But if you wanted to use it please ref this link for alternative options.s 

https://salesforce.stackexchange.com/questions/97184/how-to-use-forceinputfield-and-forceoutputfield-inside-an-auraiteration