Questions tagged [lightning-web-components]

This tag is for questions related to JavaScript, CSS, or Markup when used in the Lightning Web Component (LWC) programming model, or for questions of interoperability between LWC and the original Aura-based lightning components.

Filter by
Sorted by
Tagged with
1
vote
0answers
1k views

lightning-tree-grid link to js function?

I'm working on an lwc that has a lightning-tree-grid (nested datatable). I've made it so the name column is type:url with a link to the record. That works, but it's not really what I want to happen. I'...
9
votes
3answers
23k views

How do I retrieve Lightning Web Components using Ant Migration tool or mdapi:retrieve command from SFDX?

This is not clear or obvious how can anyone retrieve Lightning Web Components using Ant Migration tool or mdapi:retrieve command from SFDX? What is appropriate metadata API component which ...
8
votes
2answers
2k views

Can we See the lwc Module?

This page in the LWC developer guide talks about a component JS file, in particular: Every UI component must include a JavaScript file with at least this code. import { LightningElement } from '...
6
votes
3answers
19k views

lwc: sfdx unable to retrieve lwc files

I am currently working in a dev org and I have installed the LWC e-bike component (https://github.com/trailheadapps/ebikes-lwc/tree/master/force-app/main/default/lwc/orderBuilder) When I create the ...
0
votes
1answer
899 views

LWC: Text Area Property Configuration

Looking through the LWC Documentation there is a type for each property but the only options are Integer (text field), String (text field), or Boolean (checkbox). Is there a way to create a Text ...
4
votes
2answers
7k views

Is it possible to pass parameter to javascript method from template in LWC?

I'm iterating through the list of objects, i want to render the class name based on the one attribute from the object. Here is my sample js: <template for:each={tempList} for:item="tempItem"> ...
2
votes
1answer
1k views

Unable to stretch <lightning-button> tag to fill container

I'm unable to stretch a <lightning-button> to occupy the full width of its container. While applying a style of display: block or a class of slds-size_12-of-12, for example, those styles/classes ...
0
votes
1answer
32 views

Map<String,wrapper> returned from apex class, not received by the helper controller!

I am returning a map value from the apex controller, but the helper controller doesn't receive anything data. Here the system.debug outputs the right values to be received by the controller. Plz ...
0
votes
1answer
206 views

Salesforce Lightning Web Component

I created a pre-release org for Lightning Web Component development. One of my team member is using same org for Lightning web component development. My team member has push LWC in org. I want to ...
3
votes
1answer
642 views

Error while creating Unlocked package version with LWC Components

I am trying to create Unlocked package with LWC components. When I do so, I am getting error for naming it in Camel case. Although, if I change the folder name from 'Notifier' to 'notifier' (without '...
11
votes
2answers
28k views

Set CSS class dynamically in Lightning web component

How would I translate that from Aura to LWC? <aura:iteration items="{!v.contacts}" var="contact"> <div class="{!contact.isActive ? 'slds-tabs--path dimmed' : 'slds-tabs--path'}">...<...
0
votes
1answer
475 views

Can't push LWC to a scratch org

When I create a Litghtning Web Component and click push, component does not push to an org and "All Up To Date" message received. Does anybody know how to fix it?
5
votes
1answer
430 views

Lightning Web Component - Custom Names

I know this is not a very important question and with LWCs being new probably doesn't have an answer yet, but as I'm hoping to master these every little detail matters to me. How do I customize the ...
2
votes
2answers
1k views

How to extend the rich text input of lwc with custom buttons to add new commands?

Documentation of the lwc component for rich text input (lightning-input-rich-text ...) indicates that you can add custom buttons. <lightning-input-rich-text custom-buttons={myCustomButtons}&...
1
vote
2answers
3k views

How to make rich text input work with lightning-record-edit form in lwc?

While the works fine with standard input field component (lighting-input-field) it seems not to support the lightning-input-rich-text component. With the following template the rendered form does ...
2
votes
2answers
3k views

Change handler equivalent in Lightning Web Components

I recently started looking into Lightning Web Components. Initially, I assumed that track decorator also acts like a change handler, But looks like I was wrong about it. Is there any functionality ...
0
votes
1answer
371 views

LWC-Jest installation fails

I'm having issues installing lwc-jest on a mac. The npm package installation fails with: make: /usr/local/bin/g++-4.2: No such file or directory make: *** [Release/obj.target/deasync/src/...
1
vote
1answer
1k views

SLDS classes on (new) base Lightning web components don't work

SLDS classes on base Lightning web components do not appear to work... unless I'm missing something? When I view the component below, the margin is properly applied to the div, but not to the card. ...
1
vote
0answers
58 views

Building managed package using JS frameworks/library

I'm trying to do an analysis of an existing managed package that we have built currently we have a bunch of VF pages and Lightning Components. At end of this analysis, we want to determine which JS ...
12
votes
2answers
5k views

How can we expose inherited properties from a super component’s class in a lightning Web Components through targetConfigs (design attributes)

Is there currently a way of exposing properties inherited from super classes in Lightning Web Components, as design attributes (targetConfigs), or is this a gap? I’m inheriting base classes which ...
2
votes
0answers
3k views

Invalid reference of Static Resource in LWC Salesforce

I am trying to use Static resource inside the lightning web component. while importing getting this error:- "Invalid reference SDFCImages of type resourceUrl in file StaticResourceDemo.js" here how ...
5
votes
3answers
2k views

What are the equivalent of obtaining global and local IDs (via getGlobalId and getLocalId) for Lightning Web Components?

Is there currently a way (Spring 19 Pre-Release) to get a unique identifier for a Lightning Web Component (LWC) instance? This would be the equivalent of component.getGlobalId() and component....
1
vote
3answers
5k views

How to render custom SVG in LWC

I am getting below error while trying to render custom SVG in LWC [Failed to execute 'setAttributeNS' on 'Element': 'http://www.w3.org/1999/xlink' is an invalid namespace for attributes.]
1
vote
1answer
489 views

will Lightning web Component make a way for Lightning in IE?

Lightning web component provides better support for ES6 and ES7, not available in Aura. We can do more in less code. It also transpiles code to work with IE 11 and other browsers that are missing some ...
0
votes
1answer
1k views

How to currentdate.getDate() in JavaScript for Lightning Web Component?

I'm trying to write a test class to automate my several tests in register forms, but the JavaScript currentdate.getDate() isn't working for some reason that I don't know. I'm trying the following: ...
3
votes
2answers
2k views

I am clicking delete record and record are getting deleted but it does not refresh the table in LWC

<template> <lightning-card> <div class="slds-align_absolute-center" style="height: 3rem;"> <lightning-input type="search" onchange={handleKeyChange} class="slds-m-...
51
votes
7answers
26k views

Target inner elements of standard Lightning Web Components with CSS

Say we have a LWC with the following template in a component named example: <template> <lightning-textarea class="test"></lightning-textarea> </template> And some css to ...
8
votes
3answers
8k views

Can we specify a minimum height for a lightning:datatable/lightning-datatable?

Problem lightning:datatable (rendered as a lightning-datatable) places itself in a wrapper that is only exactly as big as it needs to be. If you click on a header-level action in a table with no rows,...
12
votes
1answer
728 views

Will LightningComponentBundle and LightningComponentResource mapped into the database like AuraDefinitionBundle and AuraDefinition

I'm checking this on a Spring'19 v45 Sandbox in Execute Anonymous: [ select Id from AuraDefinitionBundle ] // ==> works fine! [ select Id from AuraDefinition ] // ==> flawless!...
13
votes
1answer
2k views

Canvas App (or equivalent) for Lightning Web Components

We are currently using the force:canvasApp lightning component to embed an external site securely into Salesforce. The Spring '19 release is introducing Lightning Web Components as the future of ...
0
votes
0answers
794 views

Lightning Web Components: .eslintrc.json and jsconfig.json missing in lwc folder

I am trying to implement this(https://trailhead.salesforce.com/content/learn/projects/quick-start-lightning-web-components/create-a-hello-world-lightning-web-component) with VS code. However, I am ...
4
votes
2answers
4k views

Lightning Web Component: how can I use Get Child Records UI API?

According to documentation, Lightning Data Services is built on top of UI API. So my question is: How I do to user Get Child Records UI API?
8
votes
1answer
1k views

Can LWC be used with other JS frameworks like ReactJS on VF Pages?

Currently the applications are built in ReactJS on top of VF Page. As part of enhancement, new components need to be built. Also they need to communicate with each other. I am planning to have LWC ...
2
votes
1answer
276 views

How to trigger analyticsInteraction aura component from Lightning web components?

How to trigger analyticsInteraction aura component from Lightning web components? Below is the code to trigger analyticsInteraction using aura component var analyticsInteraction = $A.get("e....
5
votes
2answers
4k views

Property value is not refreshing on Template when its Non-Primitive type

I am trying to update value of property in Parent Component which is pass in Child component. But after update value is reflecting in child component'c class (.js) but not in view (.html) Is it ...
0
votes
1answer
919 views

how to get Personal Access Token from my integrated application LWC. I am using js only [duplicate]

I am using LWC for integration my application. I need to get the Personal Access Token at runtime. Is that possible to get? Presently, I hardcode Personal Access Token in my LWC application. like ...
0
votes
1answer
1k views

Unexpected file found in package directory: F:\Mine\SalesForce\Salesforce CLI\HelloWorldLightningWebComponent\force-app\main\default\engine.d.ts

This error Unexpected file found in package directory: F:\Mine\SalesForce\Salesforce CLI\HelloWorldLightningWebComponent\force-app\main\default\engine.d.ts. shown up when I'm trying to run command ...
5
votes
1answer
2k views

Html injections for dependent picklists used in lightning web components in tables with edit

I am trying to build a dependent picklist dynamically within a table using Lightning Web component based on what is selected in the controlling picklist field. Html injections were possible in Aura ...
12
votes
1answer
10k views

Can we access the key attribute when handling an event from a foreach template

// TEMPLATE <template for:each={itemList} for:item="item"> <li key={item} onclick={handleItemClicked}>{item}</li> </template> // JS itemList = ['A','B','C']; ...
1
vote
1answer
179 views

Can we do Integration of Asana to lightning Salesforce web Component? [closed]

I am doing work on Javascript using Salesforce lightning Web Component. I want to know how I integrate Asana with these components. Is that possible? Actually, I want to use the only javascript to do ...
1
vote
1answer
2k views

not able to push lightning-web-component in salesforce

I am using this command to push component to salesforce sfdx force:source:push but nothing happens this issue comes. Starting SFDX: Push Source to Default Scratch Org 14:12:52.362 sfdx force:source:...
2
votes
1answer
971 views

Lightning Web Components Easy Spaces sample application LWC component code

The screenshot below shows a comparison of the \es-base-code\main\default\ source code structures for the Salesforce sample application Easy Spaces - Lightning version v. Lightning Web Components ...
11
votes
1answer
3k views

Do we have alternative of force:hasRecordId for LWC

In looking at this page of the LWC developer guide, I have not found any details around this. Clearly to get an LWC working for a record page you can use target for RecordPage as below, making this ...
23
votes
2answers
6k views

Not able to render dynamic Lightning Web Component

I am refering Play Ground to render dynamic component in LWC. But it is giving error createElement is not defined. Have any one idea how to render dynamic component. Alternative of createComponent ...
4
votes
2answers
3k views

Lightning Web Component -- Lightning bundles must have a parent folder named ! 'lightningcomponents'

I am trying to create Lightning web component and keep getting this message, but could not figure out the issue. What does it say? Starting SFDX: Create Lightning Web Component 23:59:38.741 sfdx ...
1
vote
2answers
2k views

Lightning Web Components development

I just went thru the Trailhead for Lightning Web Components. It appears that to develop, you need to use Visual Studio Code and then use the SFDC CLI tool to deploy. Is there any way to develop ...
5
votes
1answer
4k views

Why Lightning Web Component [duplicate]

Why Salesforce has introduced new feature called Lightning Web Component (LWC)? What is the benefit over Lightning Component? I have went through various blogs to find out the actual need of LWC over ...
9
votes
3answers
19k views

Experimental support for decorators is a feature that is subject to change in a future release

I've error [js] Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning. when I try to ...
3
votes
1answer
163 views

LWC VisualCode DevHub command

Can someone please help me, I want to complete the lightening web components Trail in trailhead but i keep getting this error. I installed CLI and updated it to pre realese version I installed Visual ...
5
votes
1answer
3k views

Is it possible to deploy lightning web components to an org with an api version lower than 45?

I'd like to start developing LWCs in my dev sandbox, but it's current api version is 44. I get this error when trying to deploy my lwc. Starting SFDX: Deploy Source to Org 19:30:37.961 sfdx force:...