Questions tagged [aura-attribute]

Describes an attribute available on an app, interface, component, or event of the aura framework

Filter by
Sorted by
Tagged with
3
votes
1answer
439 views

Why should I even use the SObject type for the aura:attribute type?

Sometimes I see code using the SObject type as an aura:attribute type and I don't see why! <aura:attribute type="Account" .. It feels like it behaves the same as "Map", it's just a javascript ...
0
votes
0answers
459 views

Data binding of lightning:input and aura:attribute with type sObject(field) is not working

There is a weird scenario I'm facing while I try to bind the markup UI tags with Lightning aura:attribute as type sObject (fields). I'm trying to bind data to sobject's fields for different lightning:...
2
votes
0answers
33 views

Evaluating references of a Child Lightning Component body

How can I evaluate the body of a child component so that the expressions run in context of the included component? I am trying to do this in the same way that aura:iteration processes its body. I have ...
2
votes
1answer
336 views

Possible to use multi-line text in the designer for string aura:attribute or even rich-text attributes?

I have components which need complex parametrization like JSON values, richtext or very long text values. My attribute is defined as string like this <aura:attribute name="pageParams" type="...
9
votes
0answers
710 views

How to set attribute in the designer to a string-value which contains expression-tokens like “{!…}”?

I have defined a string attribute like <aura:attribute name="pageParams" type="String" default="" access="global" /> and in the design <design:attribute name="pageParams" label="Custom ...
0
votes
1answer
27 views

Component attribute set by one method coming as null in second method

I am calling two functions in my lightning bundle init in the following order helper.fetchAccountRequestAddressDetailsHelper(component, event, helper); console.log('before fetch'+component.get("v....
7
votes
1answer
825 views

Binding Javascript Objects to Aura Attribute Collection Types

I was testing Javascript Object Types and trying to bind them to aura attribute Collection types unsuccesfully client-side (for the most case), so I was wondering if there is a reference with a set of ...
15
votes
1answer
116 views

Passing calculated values to components makes them immutable

I'm calculating a value while I pass it to a component. But for some reason this makes it immutable, so I can't update it in my component. These are some cases I played with: <aura:application ...
0
votes
1answer
827 views

How can I dynamically create aura:attribute?

I would like to dynamically create components from other component. The thing is that, if any of those child components use events, I'd like to create the needed aura:attributes to store the info. ...
0
votes
1answer
354 views

Lightning : Select not storing changed data

The issue is that when I click on save, the data is not being saved... In the same object, I have a checkbox wich is being correctly saved, so I don't know what could be happening. I have next select: ...
2
votes
2answers
2k views

Unable to set an Inner Class as Aura Attribute type

Since SF update to Summer 18, we are facing this issue where an Inner Class could not be set as an Aura Attribute type. Lightning Component <aura:component implements="force:...
0
votes
2answers
2k views

To set a field of an aura attribute

Is there a way to append the field of an aura attribute? <aura:component implements="flexipage:availableForAllPageTypes,force:hasRecordId" description="AddBoatReview"> <aura:attribute name="...
4
votes
1answer
833 views

Unable to save a record using LDS

I use lightning data service method SaveRecord to create a record of type BoatReview__c. The boatReview__c object has following fields: I only populate Name and comment__C field using a form on my ...
1
vote
2answers
2k views

Save Error - Undefined - Lightning data service

I am trying to save a record that a user creates using a form. I get a strange error description as "Undefined" which I do not understand. Below is my component, controller and helper class. The save ...
0
votes
1answer
2k views

getNewRecord to create an empty record - Lightning Data Service

I am trying to creating a new record using LDS for that I have first create a template record which can be used to create a record. I followed the example present in - https://developer.salesforce.com/...
1
vote
1answer
8k views

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

I keep getting $A.getCallback() [Cannot read property of null when I start typing in the text fields of a form. Before adding the default I have the component as below: <aura:component ...
0
votes
1answer
2k views

Image not appearing on Lightning Component [duplicate]

In my below lightning component , I am trying to display an image using background image tag. <div class="imageview" style="{!'background-image:url(\'' + v.boat.Picture__c + '\')'}" /> I do ...
0
votes
1answer
1k views

Application Event is not getting handled in the component

I made sure I understand how the application event should be fired and handled and how the syntax is different from component Event. I executed the example at - https://ck-developer-salesforce-com....
4
votes
1answer
980 views

How to handle attributes of type “Set” in Lightning?

I am trying to collect record Ids of changed records. Therefor I'm using aura:attribute type="Set". But whenever I add the same id twice, it will be twice in my set. As described in the documentation, ...
1
vote
0answers
250 views

Dynamcially referencing an component attribute in default attribute of type=“object[]”

What is the correct way to default another attributes when declaring object[]? This: <aura:attribute name="foo" type="object[]" default="[ { 'title': 'Account Name', ...
0
votes
0answers
392 views

Deployment of lightning components using eclipse

I have tried moving lightning components and applcn from one sandbox to other. using option deploy to server but it fails. I have added package.xml file * AuraDefinitionBundle ...
0
votes
1answer
436 views

Lightning Component - Input Params and APEX

I am just starting to take a stab at Lightning and I have been struggling all day on something I hope is actually super simple. I want to take input from a user, click submit, and save the data. What ...
2
votes
1answer
456 views

How to restrict 'Paste' action in lightning component

We are trying to implement Re-Confirm email id functionality, to capture email address twice on the form. For this on the second email address field we want to restrict paste action by user. We are ...
4
votes
1answer
671 views

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

The question is fairly simple, but I haven't found any answers on the web. At the moment I have found two ways of getting the UI's values: Setting up an <aura:attribute type='Object' name='myName'...
3
votes
1answer
172 views

How do I implement unbound data binding in Lightning controllers

I know in Lightning components I can use {#v.attr} to provide independent usage of data. But how about JavaScript, is there something similar I could do when setting a components attribute? I'm doing ...
1
vote
0answers
292 views

JS controller - get all aura:attribute

I've got component with some attributes. For example: <aura:attribute name="missedCalls" type="List" access="global" /> <aura:attribute name="tryingToInitiateCall" type="Boolean" access="...
2
votes
1answer
2k views

increase sum in aura:iterator

How do I create a sum within an aura:iteration? <aura:attribute name="sum" type="Integer"/> <aura:iteration items="[0,0,0,1,0,0,0,0,0,0]" var="item"> do something with {!item} &...
5
votes
3answers
4k views

Check component attribute exists

How can I check whether a certain attribute is existing within my component? Especially when I try to access a value dynamically like component.get("v." + fieldName) I want to make sure this is not ...
9
votes
1answer
4k views

How to pass Date from Lightning to Apex

In Lightning component I have attribute and input for date: <aura:attribute name="myDate" type="Date"/> <!-- ... --> <ui:inputDate aura:id="my-date" labelClass="slds-form-...
2
votes
1answer
1k views

Target an element with aura:id for CSS

Can I use the aura:id attribute to target an element for styling? If so, is better to use aura:id instead id?
7
votes
2answers
4k views

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

I would like to set a default value to a DateTime aura:attribute, but could not find the correct format. I tried the following but it didn't work: <aura:attribute name="myDateTime" type="DateTime"...
3
votes
2answers
1k views

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

I am trying to pass a string literal to parent component as attribute. Child Component code: <div class="slds-form-element slds-hint-parent slds-has-divider--bottom"> <h1>{!v....
1
vote
0answers
624 views

Changing value of aura:attribute on .cmp page

wondering if this statement would ever work. I decalred attribute at top of page <aura:attribute name="groupTracker" type="String"/> and on an aura:if i wish to set the following <aura:...
2
votes
2answers
467 views

How to bind aura enabled property to lightning component?

@AuraEnabled public string prop { get; set;} I need to bind above apex controller property to lightning component. Please help me on this.
6
votes
1answer
538 views

How to prevent the component from being destroyed when it is referenced in multiple places?

I am referencing the component instance X within multiple other components dynamically. When I remove component instance X from one of the components, it is removed everywhere. The question is: how do ...
1
vote
1answer
4k views

Can lightning component attribute of type aura component have references to attributes from the same component?

I am trying to create a simple component: <aura:component implements="force:appHostable"> <aura:attribute name="mystr" type="String" required="false" default="hello world" access="...
6
votes
2answers
2k views

Why won't my Lightning Component Attributes store entered value

2/15/2017 Update Per comment from Doug in one of the answers this is an issue with Locker service. I verified that with Locker disabled is works as expected... In Spring 17 as of today, with locker ...
1
vote
1answer
402 views

Failed to save undefined: The attribute “onactive” was not found on the COMPONENT markup://lightning:tab: Source

I'm trying to create a lightning tabset through an iteration. Every tab should call the controller when clicked. The SFDC Doc tells, that the Action onactive can be used for this, but it does't ...
5
votes
2answers
2k views

How to store a dynamically created component in attribute of parent component using Aura.component[]?

Scenario: Re-use of dynamically created components by storing them in Aura.component[] attribute in parent component. Use-case I am creating dynamic components in a parent component, and am ...
5
votes
0answers
172 views

Can I set an ECMAScript 6 Javascript Map() Object as a Lightning Component Attribute?

I have a scenario where I am building a Javascript Map() object in my client controller helper of a Lightning component. Ideally, I would like to use this map for client-side filtering in a component. ...
2
votes
1answer
336 views

ui:InputText/Date not working on Save

I'm using ui:inputText and some other input field where the required attribute is set on "true", but it seems that it's not working as I expected to work. I've a variable defined as an aura:attribute ...
0
votes
1answer
99 views

Aura doc support attribute for lightning components

Probably very silly. I'm looking at aura doc page of my custom components and I can't figure out where to place the "support" attribute the reference page mentiones to change the status of my ...
15
votes
3answers
4k views

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

I would have expected that when a dynamically created lightning component is assigned as another component's attribute of type Aura.Component[], also referencing it in the parent component's markup ...
1
vote
3answers
4k views

Are global attributes possible in lightning component?

It is possible to create attribute as global, I mean that attribute can be get & set in any lightning component or can we set the parent component attributes?
1
vote
0answers
258 views

<aura:handler name=“change”> stops working after being called three times

I'm having an issue with a handler which initially fires as expected for three times, but then stops responding after that. The parent component has three attributes: A list of Custom SObjects A ...
1
vote
1answer
1k views

Error:: Access Check Failed! Agttributeset.get(): attribute 'record' of [closed]

How do i fix access Check issue? as per the documentation i have to perform isAccessable() check as well as component should have global access which i did. still doesn't work. Can you guys help me ...
0
votes
1answer
330 views

Expressions in literals - Pass SObject to a aura component with dynamic field value

I've created a component which accepts as an attribute an SObject. When I simply pass a JSON SObject to it, like: <c:ChildCreatorComponent obj="{ sobjectType : ...
1
vote
1answer
623 views

Lightning Components: Triggering Controller Methods on Child Component based on Passed Variables

Background: I have a lightning component I have been working on for our Lightning Community to categorize Community Groups. I have built a List of Strings via js/helpers/controller which I then ...
3
votes
1answer
3k views

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

All, This may be a basic question, but I've Googled around it and haven't found an explicit piece of documentation to back it up. I have a Lightning component with a required attribute which is a ...
15
votes
1answer
3k views

Salesforce System Error when accessing a list in @AuraEnabled method

My Lightning Component controller: doActivateNext : function(component, event, helper) { var action = component.get("c.activateNext"); action.setParams({ bpiId : component.get("v.recordId"), ...