Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [lightning-components]

The Lightning Component framework is a UI framework for developing dynamic web apps for mobile and desktop devices. It’s a modern framework for building single-page applications engineered for growth.

55
votes
3answers
17k views

What is the difference between Aura and Lightning frameworks?

Apart from Wave, the biggest announcement from a developer perspective at Dreamforce 2014 is "Lightning" and it will be announced in the big keynote by Marc Benioff today. I've started to play around ...
44
votes
5answers
10k views

How to call a Salesforce REST URL from Lightning Component?

I want to call a Salesforce REST URL from a Lightning Component. Specifically, I'm trying to call this Analytics API URL: /services/data/v32.0/analytics/reports. I see the following error in the ...
42
votes
2answers
24k views

What are the available $A JavaScript functions in Lightning?

The Lightning Components Cheat Sheet lists a few common $A functions and the Lightning Components Developer Guide references some others that are useful for certain situations. I can view the $A ...
39
votes
1answer
2k views

Lightning Experience Bug: Picklist Color Values for Lightning Dashboards not working (UPDATE: fixed in Spring 18!)

Update This issue I've originally found in Winter 17 seems not fixed in Winter 18 release. However the issue does not affect Report Charts based on Opportunity.StageName - but on Custom Objects it's ...
38
votes
2answers
4k views

Lightning Experience: How to prevent the display of obsolete data?

In many cases I've seen that LE is not displaying recent changes made in Setup immediately like in Salesforce Classic, but somehow cached or delayed. Yesterday I found an easy and perfectly ...
38
votes
1answer
7k views

Now that Lightning is here, what's the future of Visualforce? (in short - Visualforce vs Lightning)

As a developer, just curious to know what's the future of Visualforce (pages, components, email templates, etc..) ?? I believe for sure there will be backward compatibility so that the existing ones ...
36
votes
2answers
9k views

What is suggested approach to transfer VF pages to be lightning ready

So I am planning to transfer our current VF pages to lightning ready. Most of our VF pages are based on a standard controller or standard set controller and use an extension. And they are pretty much ...
30
votes
3answers
2k views

What to Javascript-test in Lightning components and what not

Let's be honest. As an Apex developer used to provide near-100% test coverage for Apex the same should be true for Lightning components. As we move more code from the server to the client more test ...
28
votes
3answers
16k views

How to use fieldsets with Lightning?

Been trying to figure out how to create a salesforce Lightning input form, based on fields from a fieldset. As an aura enabled apex method is not allowed to pass an entire fieldset I tried by ...
28
votes
5answers
5k views

(Why) Should I Use Lightning Apps?

I have looked through the documentation and Trailhead, and I have started building some Lightning Applications. I still do not understand what makes Lightning Applications better than standard ...
27
votes
5answers
13k views

Lightning: Bug in Lightning framework when using aura:renderIf?

I have a Nav component which contains the following: <aura:renderIf isTrue="{!v.showAllProducts}"> <c:showAllProductsCmp/> <aura:set attribute="else"> <c:...
26
votes
2answers
7k views

How to set up views and navigation in Lightning?

What is the best way to create views in Lightning? And then, how would you navigate from one view to another? Conceptually I'm thinking that I'll have two components, ns:foo and ns:bar, and ...
26
votes
2answers
6k views

Salesforce Lightning Component Cache

When developing a lightning components in the lightning experience, let's say I make a change to custom_componentController.js. If I want to see these changes in the lightning UI, I have to hard ...
26
votes
4answers
3k views

Lightning LockerService and Component Inheritance

(I'm hoping one of the Lightning Component developers will be able to chime in on this, as I'm rather concerned that the LockerService will break code using inheritance) Salesforce are introducing ...
25
votes
2answers
554 views

API v40 slows down Apex generated data in Lightning Components

Given a super simple scenario loading a list of 2000 Strings via Apex controller. When I process the list in a Lightning Component, there is a huge difference in performance between API v39 and v40. ...
25
votes
1answer
2k views

Lightning experience page rendering is slow

I've developed a lightning component(actually about 4 sub-lightning components all included on a main component) that queries for records, displays them to a user, and has a form for contact ...
24
votes
2answers
16k views

@AuraEnabled Support for Apex Class Return Types?

Beginning on page 141 of The Lightning Components Developer Guide, they list the valid types for aura attributes. Apex Classes and collections are included, so I've written an apex controller method ...
24
votes
1answer
462 views

Plans for obfuscation of Lightning Component source when delivered in a managed package?

This Enable Debug Mode for Lightning Components documentation says: By default, the Lightning Component framework runs in production mode. This mode is optimized for performance. It uses the ...
22
votes
1answer
845 views

What are Lightning Web Components

Salesforce has just announced a new feature, Lightning Web Components. What is this? What does it have to do with Lightning Components and the Lightning Component Framework?
22
votes
3answers
4k views

Get file from Lightning input type file

With the Spring 17 release one of the new change on the markup is the introduction of the type file to the lightning:input, however I can't seem to get the file back, only a fakepath with the name of ...
21
votes
1answer
1k views

When to use {#v.attrib} vs {!v.attrib}?

I have seen some uses of {#v.attrib} in a few of lightning components, and I'm a person who is used to {!v.attrib}. Is there a difference between them or is there a scenario where '#' has to be used/...
21
votes
5answers
6k views

Why “--” is not permitted in Lightning Component's comments in markup? How to toggle markup with class names like “uiInput--input”?

In a Lightning Component, I have the following markup which I have to comment in and out for testing purpose <force:inputField value="{!v.account.Name}" class="form-control uiInput--input input" /&...
21
votes
3answers
4k views

Unable to get force:inputField or force:outputField to render inside other markup in Lightning Component when used in Lightning Experience

I've created a Lightning component to view key details for the Account and Contact lookups from a Case, like so: The problem is, I have been unable to get field content to render when using the <...
20
votes
3answers
4k 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 ...
20
votes
3answers
11k views

Including SVG in a Lightning Component

I'm trying to animate a circular countdown timer for my lightning component, but it seems I can't use SVG tags (https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/...
19
votes
5answers
13k views

How to navigate from one lightning component to another lightning component?

I have tried several ways to do this and have not reached enlightenment. I have the same problem as outlined in this question Navigation between components in lightning I was optimistic about using ...
19
votes
1answer
1k views

How will Lightning Testing Service (LTS) be delivered when it is GA?

Took a first look at the Lightning Testing Service (LTS) that is in (open) pilot today: The Lightning Testing Service, or LTS, is a set of tools and services that let you create test suites for ...
18
votes
1answer
1k views

Refresh lightning component Opportunity page on Stage progress bar

I have a lightning component on the opportunity layout. I want it to refresh on stage change. Currently, it works when you change the stage using the edit button using the following code. <aura:...
18
votes
2answers
801 views

Feature matrix comparision: Lightning Components vs. Visualforce (now and roadmap)

Within the last view days I found that a lot of basic functionality available in Visualforce is not available in Lightning Components right now. At some features I was surprised a bit, because I ...
18
votes
4answers
762 views

Lightning - FLS

I'm reviewing the lightning documents, I don't find any relevant topics for FLS access control, in VF it works based on profile and throw error based on permissions. It seems like lot of code needs to ...
18
votes
1answer
2k views

Lightning: Expression to get dynamic field on Object/SObject

In VF it is possible to do like: <apex:outputField value="{!target[dynProperty]}"/> Which expression can be used to do similar thing inside lightning component (not inside lightning js ...
18
votes
3answers
901 views

force:navigateToComponent not loading component in Summer '17 | DOM repetition issue in Summer '17

I'm using force:navigateToComponent to navigate to a different component on click. On the first click, it navigates to the component and everything is successfully loaded. When pressing back button ...
17
votes
2answers
4k views

Infinite Loop Caused by Controller Action in Lightning Component

the following code is causing an infinite loop in my lightning component when I click the ui:button. Checking debug logs, nothing ever goes to the apex controller. .cmp layout <aura:attribute ...
17
votes
2answers
15k views

How to Disable ui.button in Lightning Component

This may be broader question on how we set HTML attributes inside Lightning? The docs state ui:button has disabled property and it works fine in VFP for all VF components. But how do I set this ...
17
votes
2answers
4k views

How to navigate in lightning out?

Actually I am using lightning components with a visualforce page, because this is the only way to override standard button (using VF) today. The problem is that, i need to redirect my user to the new ...
17
votes
1answer
14k views

lightning components: can helpers call other helpers

I like to compose functions from smaller blocks. helperA : function (component, param){ //do stuff } helperB : function (component, params){ //do stuff, and helperA(component, params) } That ...
17
votes
2answers
3k views

How does one use the Aura Test class to test Lightning Components?

By scrolling through the Lightning Reference, I've found that there's an Aura Javascript API class called Test. You can find the API docs at https://na24.lightning.force.com/auradocs/reference.app#...
17
votes
2answers
870 views

Why not use href=“/id” or href=“#/sObject/id/view” in Lightning?

Salesforce.com offically discourages Lightning developers to use href="/id" links in Lightning components and recommends complicated solutions as described here Locker-Service safe passing of data ...
16
votes
3answers
6k views

URL in <lightning:datatable>

I'm playing around with the new <lightning:datatable>. Looking at the documentation, it says that it supports type url for the column data. However, that renders the value of the field as both ...
16
votes
2answers
866 views

Sharing JavaScript between multiple Lightning Components

In a Lightning Component we have the notion of a JavaScript controller and a helper. We can use the helper to call code from the JavaScript controller that is shared between functions, so we can ...
16
votes
3answers
7k views

Lightning - How to use force:inputField?

I've seen that since Spring'15, there are new standard components available in Lightning. I've been looking for a component that would be a sort of apex:inputField, but in Lightning. The force:...
16
votes
2answers
426 views

Locker Service: Cannot set field values that were null on records from SOQL or SObjectType.newSObject()

We have a number of Apex controllers that are shared between Visualforce and Lightning. When these controllers init record values, there are some cases where no record value exists, so the method uses ...
16
votes
1answer
757 views

jQuery DOM manipulation performance in Lightning is awful with LockerService enabled

In a Lightning app that I am building, there is a reasonably large table (has 7 rows for each contact we are dealing with, there can easily be 40+ contacts that we are showing data from). Most of the ...
16
votes
1answer
526 views

Lightning Components: how to invoke “New Note” panel from custom components?

On the Standard-Related-List "Notes" there is a New Button. This New Button opens a Panel on the bottom of the screen like this: How can I invoke the opening of this "New Note" Panel? I've tried so ...
16
votes
1answer
549 views

String literals with {} braces may get mangled in Lightning JS

This has already been reported - I'll add my colleague's case number for it when I have it available - but I don't see it on StackExchange so I thought I'd post here. Basically we discovered while ...
15
votes
2answers
13k views

Lightning App - getting URL parameter

We are planning to convert some of our VF pages to Lightning apps. Some our VF pages, particularly surveys are URL parameter-driven, since we send survey links directly to users, i.e. https://[...
15
votes
1answer
7k views

Help me to undestand this lightning helper methods (reduce & showHelpMessageIfInvalid)?

I went through the lightning guide and try to learn the form controls, I got the below code which show that it validates the form fields, But would like to see more insight on 1 reduce - what this ...
15
votes
3answers
381 views

How to send wrapped generic SObjects from Lightning to Apex

I have a lightning component with an apex controller that wraps generic records in an inner class. When I send the wrapped records to apex and receive them as generic SObjects, I get this error ...
15
votes
4answers
400 views

Why EXACTLY not calling Aura.Action attribute from Lightning Controller using $A.enqueueAction()?

Since the event registration/subscription feels like a long roundtrip for simple things, I found a "hack" for implementing a simple onchange handler in my own Lightning Components in form of an Aura....
15
votes
1answer
3k views

Forcing a refresh in force:recordData

force:recordPreview had a ignoreExistingAction attribute that would force a server trip. I have an issue right now where I have two components: Comp A - Contains a list of sObjects, saves/updates ...