6

You cannot do this in salesforce lightning - Aura or LWC. Below are the options that works in salesforce lightning Aura Option 1: Have filtered logic in Javascript and use it in Component. This is preferred. CONTROLLER: let myFullObject = { myList: [...], }; myFullObject.myFilteredList = myFullObject.myList.filter(element => ...); component.set("v....


4

Be careful with cAsE-sEnSiTiViTy: <aura:If isTrue="{!PQs.AnswerID == Dropdown.Listid}"> Is not: <aura:if isTrue="{!PQs.AnswerID == Dropdown.Listid}"> Aside from that, consider using eq instead: <aura:if isTrue="{!PQs.AnswerID eq Dropdown.Listid}"> Note that the docs specifically state: Don’t use the == operator for objects, as ...


3

There is a bug in lightning aura conditional rendering aura:if. If you unrender and rerender immediately (i.e., When isTrue condition becomes false and immediately true) then the components do not get unrendered properly. So, from next transaction onwards component.find will be returning an array in which the first element (0 index) will always be the one ...


2

You can use the indexVar attribute to set the index to the name of the checkbox and use that. Component. <aura:component > <aura:attribute name="items" type="List" /> <aura:handler name="init" value="{!this}" action="{!c.init}"/> <aura:iteration items="{!v.items}" var="item" indexVar="index" > <lightning:...


2

when you use component.find from Aura:iteration it gives array of components if that aura:iteration had more than one items, so you 'll to get list of distance values if aura:iteration had more than one item. you need to change the code to get list of distance values. try below code let me know if you get any issue. helper.js var lstdistanceval= [].concat(...


2

component <aura:component> <aura:attribute name="options1" type="List" default="['1','2','3']"/> <aura:attribute name="options" type="List" default="[{'label': '', 'value': 'option1'}]"/> <aura:attribute name="value" type="String" default="option1"/> <aura:iteration items="{!v.options1}" var="organization"> &...


2

From documentation, If the local ID is unique, find() returns the component If there are multiple components with the same local ID, find() returns an array of the components If there is no matching local ID, find() returns undefined So, you should first check if its array, and if its array you can get length or else you can ...


1

In lightning component, you cannot assign aura ID a dynamic value. Check this post for more information. You can leverage HTML Data attributes in iteration to keep dynamic IDs or Keys for identification of particular data in the controller using the event from where the element was triggered. Aura Component Snippet <aura:iteration items="{!v....


1

Need use only one aura:iteration <!-- Adds Debt Type field--> <aura:iteration items="{!v.DebtsType}" var="DebtType"> <lightning:select aura:id="{!DebtType.Debtid}" value="{!DebtType.Debtvalue}" label="{!...


1

I see this asked a lot. The Aura framework does not handle this syntax currently: {!Object[propertyName].value} What you will have to do is use another component / controller to perform this functionality like this answer Is there a way to access object properties in Lightning expressions


1

There's no way to do that directly in markup. You'll need to massage your data so that the output is correct.


1

In my apex class (BoatSearchResults) I had included the Geolocation__c field as part of the query. The result of this was that the callback function would always error out unless I converted the return to a JSON string then parsed the string from the component's controller. Given that the requirements do not outline including the Geolocation in the ...


1

i achieved by using onclick event on child tr instead radio button. i used HTML data-attribute to bind parent row index and child row index, so i got both indexes when ever click on any child row then CopyValues function calls and bind the selected child row values to parent row. cmp <aura:attribute name="OrderItems" type="List" /> <aura:...


1

You can use lightning:datatable for this requirement. You can avoid using aura:iteration over html table element & relying on aura:id to get selected values. Base lightning datatable component will do all the things without much code. .cmp: <lightning:datatable columns="{! v.mycolumns }" data="{! v.mydata }" keyField="id" onrowaction="{! c....


1

Iterate over var(acc) as acc is one of account. <aura:iteration items="{!v.AxisWrapperList}" var="acc" indexVar="sNo"> <aura:iteration items="{!acc.OpliWraList}" var="li"> {!li.opli} {!li.opliNo} </aura:iteration> </aura:iteration>


1

To iterate over the OppLIWrapper you need to use the var name of the AxisWrapperList (acc here). <aura:iteration items="{!v.AxisWrapperList}" var="acc" indexVar="sNo"> <aura:iteration items="{!acc.OpliWraList}" var="li"> {!li.opli} {!li.opliNo} </aura:iteration> </aura:iteration>


1

Thanks for the help Zuzana. I figured out a workaround. It works when we assign blank object to iterating object, and then assign new object. like below, component.set("v.campaigns", {}); component.set("v.campaigns", campaigns); But setting activeSection won't work just after this statement. For that I figured out another workaround. After I am resetting ...


1

You do not use merge syntax in component.set. Change those lines to use just valueProvider.attributeName syntax. We can also eliminate the if-else with a little bit of logic. // if(listOfRecord.length>0){ // Removed If here component.set("v.PYCheck", listOfRecord.length>0); component.set("v.PYListSize", listOfRecord.length); component....


1

The attribute needs to be a list: <aura:attribute name="Companies" type="Company__c[]"/> ... or ... <aura:attribute name="Companies" type="List" /> The return data must not be stringified: component.find("Id_spinner").set("v.class" , 'slds-hide'); var data = response.getReturnValue(); component.set("v.Companies", data); Evetyhing else is ...


1

You are missing the init handler because of which the method is not invoking on init: <aura:attribute name="set" type="object"/> <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> <div class="slds-text-body_regular"> <aura:iteration items="{!v.set}" var ="d"> <lightning:input label="Profile" ...


1

You can't really call a method like that. The typical solution is to provide an additional attribute in your data to determine which way you should go. You can then use the ternary operator in order to determine which icon to show: var retVal = result.getReturnValue(); var oppTypes = ['OPENOPPORTUNITY','LOSTOPPORTUNITY','OPPORTUNITYWITHORDER']; retVal = ...


1

You are missing the data binding ! in selected: <option text="{!item.Name}" value="{!item.Id}" selected="{item.selected}"/> It should be: <option text="{!item.Name}" value="{!item.Id}" selected="{!item.selected}"/>


1

You can directly create a property selected in questions and get it onchange. HTML: <aura:attribute name="options" type="List" default="[ {'label': 'very good', 'value': 'very good'}, {'label': 'good', 'value': 'good'}, ...


1

cmp <div label="Set Id" data-record="{!object.Id}" onclick="{!c.action}"> {!object.Name} </div> controller.js action : function(cmp,evt){ var objId = evt.currentTarget.dataset.record; var cmpEvt = cmp.getEvent("cmpEvt"); cmpEvt.setParams({"id" : objId }); cmpEvt.fire(); }


1

The problem comes from the fact that you have multiple tasks with the same list id. However, you're iterating through your list of tasks and you overwrite the previously map value by the new one. Because your map values are not a list of tasks. You have to use a Map of type: Map<String, List<String>>. The code will be: Map<String, List<...


1

It appears that this "nested find" (per se) is not possible. I opted to dynamically create each lightning:layoutItem and each, respectively, nested lightning:inputField in an init handler for my component. This allowed me to assign an aura:id as I created each individual component.


Only top voted, non community-wiki answers of a minimum length are eligible