Skip to main content
17 votes
Accepted

Dynamically created component with aura:id, set as a Facet inside a parent component, is not found when calling find() and passing in aura:id

This is a bug inside the framework where dynamically created components are not getting properly indexed to their parents. Doesn't look like anyone is actively working on it right now. If you'd like ...
TrevorBliss's user avatar
  • 3,833
11 votes
Accepted

Salesforce System Error when accessing a list in @AuraEnabled method

Looks weird,might be a bug. As a workaround, try passing the stages array as string from the component and deserialize the string to List<BpiStage> in the apex controller. Controller.js ction....
Praveen's user avatar
  • 10.1k
11 votes
Accepted

What's the correct format to set a default value to a DateTime aura:attribute?

Very interesting question. I did some research on it and found this gitHub repository, someone has tried to play with default values of all kinds of basic types. Scene 1: Simply putting the below ...
Santanu Halder's user avatar
10 votes
Accepted

Using a Map type attribute in aura:if

You can access the attribute as v.navItemPrivs.Task and that should work just fine. Object properties are accessible by dot notation but not brackets unless they are integers. Unfortunately you can't ...
Charles T's user avatar
  • 11k
10 votes
Accepted

How to pass Date from Lightning to Apex

I'm afraid you won't be able to do it. As @itzmukeshy7 said, the way to go is to pass the Date as a String and then cast it inside your Apex method. There are several issues like this currently in the ...
Fabien Taillon's user avatar
10 votes
Accepted

Apply a css class depending on the value of the aura:attribute in a lightning component

Yes, absolutely. You can use expressions in the class attribute of your Lightning components and HTML elements. <div aura:id="myDiv" class="{! v.myBooleanAttribute ? 'my-class-good' : 'my-...
David Reed's user avatar
  • 93.2k
8 votes
Accepted

Lightning Components - Are passed in attributes available to the init method?

init event of the child component will called long before the parent's. Add aura:doneRendering event in the child component and access the list in in the child. Order in which init fired is mentioned ...
Praveen's user avatar
  • 10.1k
8 votes
Accepted

How to handle attributes of type "Set" in Lightning?

I think that the problem is in javascript when you are declaring mySet. Try this: var mySet = new Set(component.get("v.mySet")); Edit: the best solution is var changes = cmp.get("v.changes") || ...
Torsen's user avatar
  • 1,534
8 votes
Accepted

How do I use a JavaScript object as an aura:attribute?

As Kris Gray (@GrayJustise) pointed out on Twitter once, Object is a simple Object, and Lightning doesn't know what to do with it, so it does this only safe thing it can: it makes it a String. Instead,...
sfdcfox's user avatar
  • 497k
7 votes
Accepted

Lightning Components: declare attributes or get the values from the DOM?

get is faster than find and then get, simply because the latter requires calling two methods while the former only requires one method. In addition, find may return either no values (null), one value (...
sfdcfox's user avatar
  • 497k
7 votes

Passing calculated values to components makes them immutable

This was intentionally designed this way, and reason for that is an edge case. You can still change the value, you simply need to clear the reference before setting it first. ({ changeValue: ...
Kris Gray's user avatar
  • 3,106
7 votes

How to set inner class list as aura attribute?

If I read this right, you want to use an inner class on aura:attribute tag. You cannot (rather should not) use an inner class as an aura attribute, instead you need to handle it differently. If that's ...
Jayant Das's user avatar
  • 30.6k
6 votes
Accepted

"No COMPONENT named markup://aura:method found" when saving component

You get the below error if the <aura:method/> is not an direct child of <aura:component/> No COMPONENT named markup://aura:method found” when saving component <aura:component> ...
Praveen's user avatar
  • 10.1k
6 votes
Accepted

Aura Attribute of Type Map is not working

UPDATE I believe this is a bug. If you do not default your Map to empty object default="{}", then lightning appears to not register the existence of the Map declared in the markup. So, the fix is ...
Caspar Harmer's user avatar
6 votes

Why won't my Lightning Component Attributes store entered value

This issue is currently scheduled to be fixed in the Summer '17 release by leveraging Proxy as Doug mentioned in the comments to another answer. I've verified the fix with a very similar scenario on ...
TrevorBliss's user avatar
  • 3,833
6 votes
Accepted

How to bind aura enabled property to lightning component?

Use a method to set the value from VF page. @AuraEnabled public static CLASSNAME GetProp () { CLASSNAME result = new CLASSNAME(); result.prop = value; return result; } In the component: <...
Virath C. Liyanage's user avatar
6 votes
Accepted

increase sum in aura:iterator

You cannot dynamically calculate the value of sum via markup expression in Lightning Component. You need to calculate the value in the controller.js and store in a separate attribute in the component ...
Praveen's user avatar
  • 10.1k
5 votes
Accepted

Image not appearing on Lightning Component

Your CSS selector is apparently incorrect. It should be: .THIS .imageview { Instead of: .THIS.imageview { Use the latter for top-level elements, and the former for nested elements, such as those ...
sfdcfox's user avatar
  • 497k
5 votes
Accepted

$A.getCallback() [Cannot read property of null- Simple form

Edit: lightning:input has label and name as required attribute. <lightning:input aura:id="boatRevw" label="Title" name="Title" value="{!v.boatReview.Name}"/> Your ...
Saumya Ranjan Satapathy's user avatar
5 votes
Accepted

Binding Javascript map to Aura Attribute map

Don't use the Map type, just use object notation. Instead of: let productInfoMap = new Map(); Use: let productInfoMap = {}; Also, better to use const if you don't reassign, which seems unlikely ...
Adrian Larson's user avatar
  • 151k
4 votes
Accepted

Lightning Object binding via attribute

I've had this happen before and was able to resolve it by using a default attribute to predefine the keys/values of the object fields that you want to bind on. Try something like this: <aura:...
Caspar Harmer's user avatar
4 votes
Accepted

Lightning component not getting on load value

Unlike force:recordEdit/reviewView the forceChatter:feed component does not support dynamically changing v.subjectId - I just went and looked and there is no logic in the component to trigger ...
Doug Chasman's user avatar
  • 10.1k
4 votes
Accepted

Aura Components are being aggregated on 'items' change of aura:iteration

Thank you for the demo code. I have confirmed the problem and filed a bug. Here are the conditions to get the component leak: LockerService enabled Nested <aura:iteration> The inner elements ...
JF Paradis's user avatar
  • 2,460
4 votes

Dynamically created component with aura:id, set as a Facet inside a parent component, is not found when calling find() and passing in aura:id

as @techbusinessman stated, the only workaround (so far) to get the value from a dynamically created component is to use : var value = component.get("v.*attributeName*").get("v.value");// for type="...
Hareesh Mohan's user avatar
4 votes
Accepted

Why won't my Lightning Component Attributes store entered value

Code is working as expected. In the above approach there is basic problem. Lightning does not initialize any variable itself. In controller testString is not defined so, it is not even getting set ...
Ashwani's user avatar
  • 22.6k
4 votes
Accepted

component.get is giving null on parents component's controller

First of all, using attribute name as value is not recommended. The reason for not getting the expected value in the alert is that the method named doInit is fired much before the value is passed to ...
Junaid P Khader's user avatar
4 votes

Check component attribute exists

Another way of doing it is by using the util methods, such as: var someAttribute = component.get('v.someAttribute'); if ($A.util.isUndefinedOrNull(someAttribute)) { // Do something when ...
Florissant53's user avatar
  • 1,433
4 votes
Accepted

Check component attribute exists

Thanks for validating that not everybody gets the exception- so I found out that when Debug Mode is enabled (Setup -> Lightning Components -> Checkbox) the exception is raised to the user interface. ...
Christian Menzinger's user avatar
4 votes
Accepted

Lightning Component - Input Params and APEX

If you're going about it the way you are, you'd want to use Component#find and then Component#get to get the value: action.setParams({ "name" : cmp.find("houseNameInput").get("v.value"), "...
sfdcfox's user avatar
  • 497k
4 votes
Accepted

Application Event is not getting handled in the component

Application event handlers cannot have name. In the same link you have added in the question read it through and it has the information. Only component event handlers have name. <aura:handler ...
RedDevil's user avatar
  • 7,841

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