Questions tagged [aura-iteration]

questions regarding the aura:iteration component. This coomponent iterates over a collection of items and renders the body of the tag for each item.

Filter by
Sorted by
Tagged with
12
votes
4answers
3k views

How do we identify which lightning input is updated in an iteration?

I'm trying to construct a page that allows users to edit records, and it should be in SLDS, so I'm trying to use lightning:input to minimize the amount of code I need to write. Ultimately, a method ...
12
votes
2answers
1k views

Is it possible to use the new v41.0 lightning:outputField in huge numbers inside tables? Is it possible to extend it?

Today I'm giving the new v41.0 <lightning:outputField> a try. I want to use it massively inside an <aura:iteration> to build a data-table and want to accomplish the following: ...
7
votes
3answers
12k views

component.find an aura:id item created in aura:iteration

I am building a menu component. One menu-item is a sub-menu with list of opportunities, this list is created with aura:iteration over a list of opportunities. When selecting a menu or a sub-menu, I ...
6
votes
1answer
22k views

How to check List size in aura:iteration

I am showing list of opportunity in a Lightning component. And I want to display them if the opportunity list size > 0 . i.e here ( opportunityList > 0) <lightning:select name="...
5
votes
1answer
256 views

Is it prudent to use force:recordData (and similar) within aura:iteration?

The aura framework and lightning:recordData currently (Summer 18) support only single object retrieval. Let's assume I got a listItem.cmp into which I wired force:recordData in VIEW mode or a ...
5
votes
2answers
974 views

Why aura:iteration doesn't re-render when you add element to parent component's list?

I declared a parentComponent with an attribute of type list. I am passing that list to child component. In my child component, I am iterating over that list using aura:iteration . Also I provided a ...
4
votes
2answers
538 views

Lightning aura:iteration issue with deleting element after sorting

Recently I got a very weird issue with aura:iteration and don't know how to solve it yet. If I sort my list of element to ascending order and delete some element from the list then if I try to sort ...
4
votes
1answer
1k views

Updating aura attribute in 1 aura:iteration does not reflect the changes in another aura:iteration

I've created a simple lightning app which has an aura:attribute of type Object[] with 3 objects in it. I'm binding their selected property to a lightning:input of type checkbox. When I update the ...
3
votes
1answer
1k views

How do I get the value of a row of HTML table in an aura iteration with onclick?

I am trying to make a functionality where my lightning component shows a table of records and I want to make it so if you click a records row, it autofills my form with that records information. Here ...
3
votes
0answers
691 views

Lightning “change” event doesn't fire in aura:Iteration

I am passing an Object to my component and iterate through it's child records. To handle changes I added the Lightning change handler. (I made data an array, so I can set a default for demo purposes, ...
2
votes
1answer
4k views

aura:iterate in two columns

How would one create a two list column and be populated with an iterated list. Right now, both columns just repeat themselves with the same {!v.Name} data. I would like to remove the repetition and ...
2
votes
1answer
3k views

Iterating Complex Map in Lightning

I'm working a lightning component, which has a requirement of displaying a dynamic table. For that, I need to iterate over a map (Map>) and display the values. So, How can I retrieve map from apex ...
2
votes
1answer
7k views

Lightning Components: How to do nested aura:iteration of a list of Accounts with subselected Contacts?

Scenario In Visualforce we had strong patterns for implementing the rendering of hierarchical structures. As a simplified example (standing for many other use cases) let's say we want to show all ...
2
votes
1answer
529 views

Iterate related records, display images from string name of contentAsset in Community Cloud

I'm very new to Salesforce, so my apologies if my approach is all wrong. I want to display a list of buttons with images using a lightening component in Community Cloud. The list comes from records ...
2
votes
2answers
723 views

Nested wrapper class to use with Aura:iteration in lightning component

How to use aura:iteration over a list of Wrapper class object in Lightning component 1st Aura iteration works well it prints axisNo and axisName correct. But nested iterate with nested wrapper class ...
2
votes
1answer
526 views

Lightning radio selector in iteration disappears when option selected in another row

I have created a Lightning component that allows users to dynamically create their desired number of records. I implemented a data table for this. In my third column, I asked users to select from two ...
2
votes
1answer
2k views

How to conditionally render rows in iteration lightning component

I have a lightning iteration component that shows several information on accounts in a row. One of the columns allows the user to choose a lookup( I use a custom lookup component) value to edit the ...
1
vote
2answers
646 views

3 nested aura:iteration's don't work properly

I have the following object in Javascript: [{"Name" : myName, "Sub" : [{"Name": mySubname, "Items" : [{"Id": a, "Name": b},{"Id": c, "Name": d}, ...] }, {...}, ....
1
vote
2answers
477 views

how to filter the collection used in aura:iteration

I would like to have a filtered version of a collection as the source data of an aura iteration. Basically, something like this: <aura:iteration items="{! v.myList.filter(element => ....) }" ...
1
vote
1answer
13k views

Using an aura:iteration index as an array accessor [duplicate]

I am creating a lightning component that is a Day-of-the-Week picker widget. it will allow a user to enable or disable days from a list. My front has two attributes that are useful here - a list of ...
1
vote
1answer
66 views

<aura:if not working but <aura:renderif does - any reason why that you guys can see?

so the scenario is that i have an iteration within an iteration .... <aura:handler name="init" value="{!this}" action="{!c.setUpScreen}" /> <aura:attribute name="PageQuestions" type=...
1
vote
1answer
3k views

Aura Iterate, get the aura:id of a span

I'm trying to get the ID of an element that is in a loop to trigger an event, but I can't get the ID nor content of the tag. I've done something similar on visual force pages, but I did it ...
1
vote
2answers
2k views

Retrieve elements created with Aura:Iteration

I'm trying to retrieve elements using document.getElementsByClassName("") within the afterRender function. This works as expected with normal elements. However, I can't seem to retrieve elements being ...
1
vote
1answer
75 views

Trouble with aura:if

I am not sure why this is not working. I have an aura:if condition, if the check matches then the item should be displayed. Here in this code below I am checking the ofc.agentName is not empty then ...
1
vote
1answer
103 views

Get Task description with line breaks in SOQL

I have a lightning component that displays a List of Tasks in a sidebar. I use a SOQL query in the controller to fetch a List that fits the criteria and display them in the component. I manually model ...
1
vote
2answers
1k views

How to find id of lightning component tag which defined in iteration?

<aura:iteration items="{!v.List}" var="item" indexVar="i"> <div id="{!v.globalId + '_option'}" data-index="{!i}" data-id="{!item.Id}" onclick="{!c.jsFunction}"><text-...
1
vote
1answer
2k views

Display fields if null in an aura:iteration

I'm making an edit records component on Opportunity where I display fields from related objects like Account, the Primary Contact and Contact Role only if their value are null. For the Account and the ...
1
vote
1answer
70 views

Radio Button within Iteration - When user selects radiobutton, store the associated sourceId in attribute 'accountId'

Currently, I'm iterating through a wrapper that includes sourceId (aka accountId) and Opportunity Name, etc. When the user selects a radio button, I want to capture that sourceId in an attribute at ...
1
vote
1answer
514 views

Second <aura:iteration> not working with object/array datasource

I have a Lightning component with two <aura:iteration> <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> <aura:attribute name="invoices" type="Object" /> <aura:...
1
vote
1answer
794 views

Passing an aura:iterated list item to JS controller

The goal is to pass a "comment__c" rich text field on an iterated object to its JS controller to perform a string operation on it before it's returned to limit a tooltip it is to appear into 250 ...
1
vote
1answer
497 views

How to fetch the accounts based on a value checkbox

I have a dynamic checkbox generator which is bound by city on the account which works fine all cities are rendered with a corresponding checkbox. When I select the checkbox a city is added to a list ...
1
vote
1answer
10k views

How to use lightning:outputField and lightning:inputField inside an aura:iteration

How can I use the new v41.0 <lightning:outputField> inside an <aura:iteration>? I have tried this <aura:attribute name="Opportunities" type="Object" default="{}" /> <aura:...
1
vote
1answer
30 views

aura:interation Field Order

I'm developing a component to add multiple items (in this example debts). When a new debt is added I need the fields to display like so: At the moment the fields display like this: Here is my ...
1
vote
1answer
52 views

Display table with data from two sources - array and map - Aura Components

I have related objects with a one-to-many relationship. For example: Owner1 ---> Thing1 Owner1 ---> thing2 Owner2 ---> Thing3 I want to display data from these objects in a table ...
1
vote
1answer
1k views

Aura Components Specialist: Step 3: Completed but tiles do not display data?

I've just completed step 3 of the Aura Components Specialist superbadge however the tiles for the boat search results just display an empty block on the page. Not sure why this is happening. I've ...
1
vote
2answers
174 views

Display radio group dynamically

I'M trying to display radio groups inside aura iteration,the number relays on the number of elements of the Questions list,but not only selected options are not being checked ,it also happens that ...
1
vote
1answer
169 views

Aura iteration for Kanban

I'm trying to create Kanban. My lists have many cards, but I can see only one card per list. I added ORDER BY ListId__c to SOQL but I still can't see other cards. First 2 lists have a few cards. How ...
1
vote
2answers
938 views

Is it possible to “find” an aura:id within an aura:id?

I have a component where I am building a lightning:recordEditForm using fields based on a different field sets that looks a little something like this: <aura:component> <aura:attribute ...
1
vote
1answer
462 views

Aura iteration returning blank rows(with correct number of rows)

My requirement is to display all the saved values on load for a Custom object called Company__c. Fields being Full_Name__c (text), Address__c(text area) , Director_Name__c (text), Phone__c (phone) and ...
1
vote
2answers
100 views

How do i iterate over a list with 3 different object types in lightning component?

I am building a lighting component which needs to iterate over a list with three different object types but I have run into a problem because I cannot write an aura if expression which checks the ...
1
vote
1answer
861 views

Aura:iteration with Data Tables and setting the order to descending as rows are inserted

So we have a client that has a form page where a Data Table is built based on input. As they enter items the table sorts them by index (i'm assuming) in ascending order. Without making the user sort ...
1
vote
1answer
883 views

To compare old and new value inside aura:iteration in Lightning component

In Lightning I have a requirement where I will iterate a List and display it as a table.While iterating I need to compare old value(last iterated row value) and new value (value in current iteration) ...
1
vote
1answer
1k views

aura:iteration to display data in columns after certain count

<fieldset class="slds-form-element slds-m-top_xx-large form-fields-width borderForBoxes"> <LEGEND class="slds-form-element__label tlabel slds-text-body_small"> ...
1
vote
1answer
1k views

How to navigate to one component to another by passing parameters

I'm new to Salesforce. I have just started with lightning Aura components. I want to understand simple workflow of aura. Can anyone help me with the code for below requirement. Thanks in advance. ...
1
vote
1answer
291 views

Add one item per line using aura: iteration and lightning button

Clicking an "add" button would like the lines below to be always added one below the other. Today I have a problem in which two items are added per line. Right way: Como está hoje (errado): My ...
1
vote
0answers
60 views

aura:iteration label of current field

Is there a possibility to get the Label of current field using aura:iteration ? <aura:iteration items="{!v.objectName}" var="objectName"> <lightning:input value="{!objectName.field1}" ...
1
vote
1answer
869 views

Find value of div inside aura iteration on icon click!

I am trying to find the value of a div which is inside aura iteration on icon click which is also inside the same aura iteration. Here in this code below I am trying to find the value of the aura:id=...
1
vote
0answers
138 views

create account from a button inside aura iteration and set account id to the adjacent lookup column

I am new to lightning. I am inserting list of contacts in aura iteration with account lookup. I made custom component for searching account, which works fine. But i also need to give option to create ...
1
vote
0answers
1k views

Lightning button attribute “Disabled” in “aura:iteration tag”

I'm trying to enable a lightning:button if a lightning:inputField changes. This is the aura:component: <aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,force:...
1
vote
1answer
741 views

Lightning Component integer attribute not matching javascript integer

I have an attribute of type integer. <aura:attribute name="selectedRowNum" type="integer" /> I also have an iteration component in which I get the index of the current object that is being ...