Questions tagged [javascript-controller]

A controller is a JavaScript Object, created by a standard JavaScript object constructor. In the Aura Framework, the JavaScript controller is client-side.

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

How do I debug my lightning component?

I have seen and read many posts in regards lightning component errors and realized there are no questions actually asking how to debug them. I recently stumbled upon: How do I start to debug my own ...
7
votes
1answer
190 views

Can we use the event's attribute “path” in Lightning?

I've been working on a pretty complicated component, and I've had all kinds of trouble simply trying to identify which element is currently being used. After all sorts of experiments, I found a really ...
3
votes
2answers
3k views

urlEvent is undefined

We have below code being called from Cancel button on a Lightning component. We have used this lightning component on VF page. navHome : function (component, event, helper) { var urlEvent = $A....
3
votes
2answers
17k views

Lightning response.getReturnValue() question

I did not find much info on the "response.getReturnValue" function and what it exactly returns. I understand that this is the function that must be used when a Client Side JS controller calls a Server ...
3
votes
1answer
4k views

$A.util.removeClass not working in some cases

On init of a component, I want to hide an element lightning:buttonIcon if some condition is satisfied(see controller code). In this case it is getting satisfied and I am reaching the code where ...
2
votes
1answer
270 views

Can't handle an Application event in Lightning

I am trying to handle Application event in a listening component but it doesn't work for some reason. Please, help. I can't write in console log "here" in the end Application <aura:application ...
6
votes
2answers
828 views

Locker Service and Fullcalendar.io

I have seen that there have already been some questions regarding the open source Fullcalendar.io and the various libraries associated with it, and the strict requirements of Locker Service, but I was ...
4
votes
1answer
665 views

Packaging custom labels used in lightning helpers and controllers

So in our lightning code base we usually refer to labels from js helpers and controllers as the following (it's static reference, not dynamic one): $A.get("$Label.c....
2
votes
1answer
463 views

Is there a way to react to a related list being changed in lightning?

Simply put, i need to make a lightning component, that depending on related objects to the one whose page i'm in, has different functionality. If the user creates a new related object via the related ...
1
vote
2answers
3k views

Is there any function to deserialize an JSON to an array in lightning component?

I have been using JSON.parse() function to deserialize JSON object, It is not working for special characters. For example, if the JSON contains a date it being converted as 2012&#x2F;04&#x2F;...
3
votes
2answers
950 views

LWC: Inside an HTML template for-loop, set loop variable property to new user-typed input element value?

I'm trying to write a Lightning Web Component (yay, first one). Still in the "proof of concept; can I get user input to propagate around the page?" stage. I have a List<MyApexWrapperClass> ...
2
votes
1answer
476 views

How to pass a Javascript array to an Apex controller?

I have the following problem, I want to assign an array of javascript to a list of the apex controller. I have to update 3 list of the saleforce page with a "save" button and pass to the controller ...
2
votes
2answers
3k views

How to add dynamic variable to custom label in lightning javascript helper class

I am using a custom label in lightning controller/helper as: $A.get("$Label.c.MaxCountProducts"); And the label has value as: Maximum Product(s) count {0} is exceeded. I want to dynamically ...
1
vote
1answer
2k views

Lightning Component: Retrieve values from dynamic forms

I have a list of records and an accordion style form for each record: this is achieved with aura:iteration and few <tr> tags. I've used the indexVar on aura:iteration to uniquely identify ...
1
vote
2answers
4k views

Click outside of popover to hide?

I'm trying to do the popover shown on the lightning tutorial: https://www.lightningdesignsystem.com/components/popovers/ I'm new to lightning and I have been looking around on how to hide the popover ...
0
votes
0answers
26 views

Copying fields data when checkbox is checked in multiple rows(Visualforce Page) [duplicate]

I have challenge I'm working on a visualforce page I want whenever the checkbox is checked I want to copy the values into input text fields in visualforce page. So here I have multiple rows and ...
0
votes
1answer
615 views

Salesforce Calling Server Side action Infinitely from Lightning Component

I am facing a weird issue of Salesforce calling infinite times the Server side Action from the Lightning component. Has anyone faced a similar issue? I am pasting the code for your reference. <...