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
1
vote
1answer
18 views

How to assign aura:attribute for objects with default value null?

This must be a a very simple question, but may be I'm doing it wrong. I wanted to set default aura:attribute value to null on lightning component as below. e.g. <aura:attribute name="selectedObj"...
1
vote
1answer
16 views

Render aura:attribute within aura:unescapedHtml

I'm using the aura:unescapedHtml component with some custom labels that will also include markup. For example: Custom Label: <labels> <fullName>Register_Text</fullName> <...
5
votes
2answers
7k views

How do you set a default value on lightning component force:inputField which is a lookup?

I have a lightning component (Summer 16) which contains a "Task" attribute as follows: <aura:attribute name="task" type="Task" default="{ 'sobjectType': 'Task' }"/> Further down the page, ...
3
votes
2answers
375 views

Lightning component attributes: Difference between Array and List

According to this document, the type type[] is "An array of items of a defined type" and the type List is "An ordered collection of items". I've tested the output of both structures (with integer ...
9
votes
4answers
6k views

Uncaught TypeError: a.getAttribute is not a function

Scenario: I have a component that has an <aura:renderIf> within an <aura:iteration>. The <aura:iteration> references a component attribute called "selectedItems" to display a list ...
0
votes
2answers
38 views

Selection is not working for third selection

I write following component code : <aura:component controller="TransactionsalSecurity" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:...
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/...
0
votes
1answer
39 views

Error on second selection for same code in lightning code works fine for first time but second time it gives error

This code runs fine for first selection and also for first time but for second selection it gives following error This page has an error. You might just need to refresh it. Action failed: c:...
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
28 views

Hide text using aura:if

I'm trying to troubleshoot here for a day. My end goal here is to hide the Test text, depending on the Product_Family__c value. Here is the code, please let me know what am I missing. Apex public ...
0
votes
3answers
53 views

Show/Hide Text depending on a field value using Aura Component

I am trying to hide/show text depending on other field value. Here's the code. Component <aura:component controller="updateCheckBoxPlan" implements="force:appHostable,flexipage:...
0
votes
2answers
32 views

Aura iteration is not holding on particular selection value resetting to first value every time loop is started

<lightning:select label="Permissionset Names" onchange="{!c.doInit}" > <option>None</option> <aura:iteration items="{!v.set}" var ="d"> <option>{!d....
0
votes
1answer
44 views

You might just need to refresh it. Assertion Failed!: Provider type not supported : false Failing descriptor

Iam facing following error with my code: This page has an error. You might just need to refresh it. Assertion Failed!: Provider type not supported : false Failing descriptor: {c:Picklistversion2} ...
0
votes
1answer
20 views

Retrieve currentRecord from aura:iteration to controller.js

I am quite new in lightning and I need an hint in order to resolve a problem. What I would like to achieve: in a table component, for each record I would like to see a column with different icon ...
3
votes
2answers
354 views

password design attribute

My component has a property that is a password to a web service. The current data types for design view are String/Int/Bool and they all display during the design time. Is there a way to display a ...
5
votes
2answers
138 views

Detect lightning:recordForm change in mode attribute

I'm trying to disable some surrounding components based on the mode attribute within lightning:recordForm (i.e. anytime I'm in edit mode, I'd like to disable a lightning:buttonMenu that sits just ...
0
votes
1answer
21 views

on clicking save, record is not inserting using lightning component

im new to lightning, i created a lightning component to insert contact records,but when i click on save record is not getting saved.here is my code apex controller public class cninsert { @...
1
vote
2answers
113 views

How to retrieve field attributes from dynamic fields in lightning component

I am loading my fields dynamically trough a fieldset. Using aura:id="requiredField" on the lightning:inputField I can get the fields using a map in the controller. I have made some fields required at ...
11
votes
3answers
2k views

Lightning: dynamic index in aura attribute with type List

related post I am having the same issue. Trying to access array with dynamic index arrayList[index] (index from aura:iteration), but Salesforce doesn't support that. Does anyone know how to do this?...
0
votes
0answers
15 views

How to copy js object from one variable to another

I have a problem in javascript controller while assigning response. I have response "response.getReturnValue()" from setCallback function which is a list of records. I want to assign this to 2 ...
1
vote
1answer
186 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. ...
0
votes
1answer
28 views

Creating dynamic component with buttons, events not getting raised

I have created dynamic component but somehow the event is not getting generated : $A.createComponent( "aura:unescapedHtml", { "value": '<div class="slds-notify_toast slds-theme_default"...
-1
votes
1answer
40 views

How to use attribute type “Set” in lightning [closed]

Unable to create "set" from aura controller and use it in lightning.Its not working properly. Component: <aura:attribute name = "setObj" type = "List" default="[]"/> <aura:iteration items=...
4
votes
1answer
1k 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, ...
2
votes
1answer
29 views

force:lightningQuickAction . Will implementing this open the component as modalpop up directly?

I want to open a component as modal up from another custom of another component.If my child component has force:lightningQuickAction ,should that open directly as modal pop up without writing the ...
-1
votes
2answers
373 views

Salesforce Lightning Component Picklist Value

Hi have a requirement as follows:- I want to make a Picklist value in the lightning component. After using the lightning:Select still i am not able to get the values provided in the list. Codes as ...
0
votes
0answers
28 views

List item deletion in aura: iteration

I have a list in which every time I click the "Adicionar outro CID" button a new line with a field and a button "Remover" is added just below it: Original image: After clicking the button: If I ...
0
votes
1answer
34 views

Lightning Inter-Component Communication Patterns: how to pass efficiently pass down data from parent to dynamically created child? [duplicate]

I know two ways of pass data from parent to child in the case of a static created child components: passing attribute values from parent to child and exposing child methods to parent. The latter ...
1
vote
2answers
89 views

Lightning components: pass an attribute down to other (not nested) components [duplicate]

How to I pass an attribute (on any variable) down to other components in an application. Here is what I am working with: <aura:application extends="force:slds" description="gos_teastHarness"> ...
4
votes
1answer
889 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 ...
0
votes
0answers
72 views

Error with Object Attributes in Lightning Component

I'm getting an error when setting an Attribute with either custom or standard object in Lightning Component. Component Code <aura:attribute name="acc" type="Account" access="global" /> Below ...
0
votes
1answer
108 views

Aura Attribute becomes undefined after being set

having an issue where after a server call and confirmed setting of the getContentId : function(cmp, event) { var action = cmp.get("c.getConVerId"); console.log(cmp.get("v.fileId")) ...
2
votes
1answer
91 views

Binding Javascript map to Aura Attribute map

A similar question was asked here but unfortunately not appropriately answered. I have my aura map declared as follows <aura:attribute name="productInfoMap" type="Map" default="{}" in my ...
0
votes
1answer
45 views

Issues with aura attribute type Integer being undefined

I'm trying to make a logical decision based on count of child records of opportunity. To achieve this I have an apex method that returns a count of child records. In the js controller looking for the ...
0
votes
0answers
30 views

Retain previously entered lookup values in a Flow

Was wondering if there is a way to save a previously entered lookup value in a flow? i want to give my users the ability to click previous and still have the value they just looked up be there. It ...
1
vote
1answer
248 views

Attribute defined in one function is undefined in the other

Trying to pass a variable from one js controller function to another and having issues. The first function runs before the second and the console.log shows the Secondary attribute as defined before ...
4
votes
2answers
139 views

When do you need to use default="{'sobjectType': 'ObjectName'} for an aura:attribute?

I'm getting the below error- when I type into a lightning:input whose value attribute is bound to a field on the custom object- when I don't use the default attribute. Is this because the default ...
3
votes
5answers
795 views

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

I've created a simple component to show my issue: Markup (testComp.cmp): <aura:component description="testComp"> <aura:attribute name="testAttr" type="List" default="[[[1, 2], [2, 3], [3, ...
4
votes
1answer
49 views

How to assign a right curly bracket } as attribute value inside the markup of a lightning component?

In the markup of a lightning component I want to set this string a the value for a label-attribute: "label {1}" Let's take a lightning button as an example. But my question is unspecific and ...
0
votes
2answers
320 views

Standard aura:attributes and aura:method attribute

My question is in regards to the fact that I need to get a value from Child component to Parent component. I want to directly call a method from the parent to the child to obtain some data from that ...
2
votes
1answer
821 views

How to upload a ContentVersion with lightning component?

I'm trying to use simple apex class and simple controller like a test. But can't upload ContentVersion. What is wrong here? handleFileSelected: function(component, event, helper) { let files = ...
2
votes
3answers
329 views

How to pass dynamic arrays in Lightning

I'm not able to pass a dynamic string array into a component without using java script. Example: values="{!v.foo + ',bar'}". In this example, the (expected) array seems to be passed as a String. I ...
0
votes
1answer
35 views

Attribute in lightning component is failing to evaluate properly in conditionals

I am unsure of what I am missing here... So I have a child component with an attribute: <aura:attribute name="recordClosed" type="Boolean" /> In the component I am doing something like this: ...
0
votes
1answer
115 views

Lightning component : Impossible to update value in form fields after resetting object value

I have this lightning component that is a form for an object called newLine : <aura:component > <aura:registerEvent name="updateFacture" type="c:factureLinesUpdate"/> <aura:...
4
votes
1answer
158 views

Bound data binding does not work with list items

Let me start by showing you what I am doing. ParentAppWithListAttr.app <aura:application > <aura:attribute type="List" name="justAList" default="['hello','world']"/> <aura:...
1
vote
2answers
1k views

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

Is it possible to apply a css class depending on the value of the aura:attribute in a lightning component? For instance I have the following component. <aura:component description="JustAComp"> ...
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-...
0
votes
1answer
890 views

Lightning combobox options attribute not showing any options!

I am trying to populate the options attribute of the lightning combobox to the values of a component attribute. The channels component attribute has all the values in it, but for some reason it doesn'...
1
vote
0answers
31 views

Userscripts manipulating aura components

Objective: To write a userscript that runs on my browser and scrapes data from a specific salesforce dynamic form that I have to fill out during my job. Summary: I am using TamperMonkey to run my ...
0
votes
2answers
88 views

How to pass radio group value from Parent to Child component?

I have to pass radio button value to the child component. Here is the code snippet of the same on the Parent component. <lightning:radioGroup aura:id="msRecTypeOptions" name=...