We’re rewarding the question askers & reputations are being recalculated! Read more.

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
0
votes
0answers
1 view

LWC datatable does not refresh its view

so I'm relatively new to lightning web components and still not understanding all of the eventhandling. I'm creating a component for a customer and I'm having some problems with my lightning-datatable....
1
vote
0answers
2 views

Lightning web component unit testing. Issue with testing row action event

Firstly, I wanted to indicate that I have poured over the LWC Recipes repo to find this, and I can't. I am trying to get test coverage on a Lightning Web Component. The component has two Sub ...
0
votes
1answer
10 views

LWC: Iterate Map twice - Map<Integer, Map<String, String>>()

I broke my head with this case. Please help. APEX Map < Integer, Map < String, String >> reportData = new Map < Integer, Map < String, String >> (); return reportData; JS ...
0
votes
0answers
11 views

Is it possible to disable row checks on lightning-datatable? (lightning-web-component)

I have a custom lwc that displays a lightning-datatable and I want some rows to have its checkbox disabled. Is it possible to set this dynamically? Or do I have to manage this via onrowselection ...
-1
votes
1answer
28 views

Progress Ring Lightning component

Looking for sample code for progress Ring lightning component, that I can use for evaluating how many questions are answered in my app. Thanks!
4
votes
3answers
41 views

How to disable the increment and decrement buttons for lightning-input field in LWC

I have a below lightning input field of type number. <lightning-input variant="label-hidden" type="number" step="0.01"> </lightning-input> as shown on the above image it adds two ...
2
votes
2answers
28 views

LWC - Iterate through rows of lightning datatable using javascript

Are we able to iterate through the rows of a lighting datatable and query each columns value in Javascript? Like this, but for a lightning datatable: https://stackoverflow.com/questions/3065342/how-...
0
votes
2answers
23 views

App builder Component visibility filters not working for lightning out

We have inserted LWC in visualforce page in classic using lightning out. Our requirement is to display the LWC to some profiles and users only. I set the component visibility filters through the ...
-3
votes
3answers
27 views

Lightning-input type text should not accept numbers in LWC [on hold]

HTML template <lightning-input type="text" label="Numeric value" pattern="[0-9]*"></lightning-input> How can I do this?
1
vote
1answer
23 views

LWC: Create New Instance of Custom Apex Class in Javascript

Im fairly new to LWC so any advice is appreciated here. How do I create a new instance of the OnboardingPeopleResult apex class below using javascript of my LWC? public class OnboardingPeopleResult { ...
1
vote
2answers
20 views

Button to Open a LWC

I need to create new button called ‘XYZ’ to be accessible on Opportunity record at the top of the page layout (Standard page) that will open a pop window with my LWC. How can I do this the most ...
0
votes
0answers
27 views

How to use jQuery Datatable in Lightning Web Component?

I was trying to get jQuery Datatables work in my LWC. I have tried this: LWC is it Possible to Load the JQuery Plugin Datatables in a Lightning Web Component? But I was not able to get it work. ...
3
votes
2answers
83 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> ...
0
votes
1answer
31 views

Adding Pagination in LWC [on hold]

How to add pagination in the Lightning web Component and restrict the result of the SOQL upto 25 results per page? Query Restriction
2
votes
1answer
17 views

template if:true with get variable is not working

I have a custom part of code that I want to be displayed based on a custom logic cmp: <template if:true={myvar}> <!-- custom code --> </template> js: @track data; get myvar(...
-1
votes
0answers
27 views

How to go about creating a Repeating Dropdown Picklist? [on hold]

So I've been tackling this problem where I need to create a dropdown picklist that once selected you click an add button and it renders a new dropdown picklist without the previous selected value ...
0
votes
0answers
21 views

Rendering Issue with LWC for nested components for nested components

I am facing issue with LWC child component rendering which is nested in parent . Description : I am building some sort of burger builder app in salesforce LWC and component nesting is like below ...
0
votes
1answer
41 views

LWC: load more with infinite scroll with template iterator or for:each

I know that there is enable-infinite-loading using lightning-datatable, but I need it to work with template iterator or for:each. I need to display each item of the list in an elaborate format, rather ...
0
votes
0answers
18 views

SFDX LWC Deploy

I Am getting this error in my VSC in Problems. Also Get an red dot next that file promting Contains Emphasized Items Failed to save Lightning Component Resource [lwc/lwcLoanValuesInput/...
5
votes
1answer
55 views

LWC - How to communicate property changes down the hierarchy

By following a tutorial (How to use custom LWC lightning component in lightning-datatable) I was able to extend lightning datatable and insert a button into the final column. Now, I am currently ...
-1
votes
1answer
19 views

How to show elements from array inside array in LWC template [on hold]

JS for(let m=0;m<ExsitingkeyPerloc.length;m++){ let result= await getAllImages({ idParent: ExsitingkeyPerloc[m].Id }) this.AllImagesToShow.push(result); } ...
0
votes
1answer
24 views

Adding new property in response JSON

I need to add any new value to the array which is storing a response in JSON. pict is an array in JS this.pict.push(new Error(JSON.stringify(responseholder) let me know if i can add new string A and ...
0
votes
0answers
15 views

Adding Service Worker to LWC

How do we add a service worker to an LWC local application? I am trying to add a service worker to an LWC application. I have added the sw.js to the project but it shows an error while registering ...
-1
votes
0answers
30 views

How to change input field color in LWC [duplicate]

I have a input field as below <lightning-input variant="label-hidden" type="number" placeholder="Calculate" class="inputFieldColor "> </...
-1
votes
0answers
34 views

Issue leveraging THREE.js in LWC

When I try to leverage the THREE.js library for my LWC component 3D rendering I am not able to get past the issue with t.perpectiveCamera is not a constructor and t.perspectiveCamera is not function. ...
2
votes
1answer
23 views

LWC Jest querySelector cannot read property 'value' of null

New to LWC and Jest -- and trying to write a succinct test on a component with multiple lightning-input elements. I have used the following pattern, which works fine -- I get a passing result: let ...
0
votes
1answer
31 views

LWC: Form Data not updating to Apex controller

Ive developed a component that lists Contacts related to an Account. Each Contact listed has an action button that opens a modal window to edit fields on the Contact. If I change the value in one of ...
0
votes
1answer
14 views

Open “Content Document Preview” via Lightning Button (Lightning Web Component)

I have a button that should display a PDF to the user when clicked. I want to replicate the behavior of the "Combined Attachments" view in the record's related list, where a click on an Attachment of ...
-1
votes
1answer
23 views

Lightning:input one message for field missing and another when name is taken [on hold]

I have a lightning:input field for a name and I need it to show one message when it's left empty and another when the name entered is already taken. Part of the problem is that I can only check for ...
0
votes
0answers
26 views

Avoid navigation to newly created record using NavigationMix

I'm working on a requirement where I want a button which will open a modal to create a new Task record in LWC. For this, I tried using NavigationMixin. But onclick of Save in the modal, it redirects ...
0
votes
0answers
24 views

how to close lightning-accordion-section

I want to close an opened section lightning-accordion-section when click a button. how to develop in LWC. Such as when I click a button then the accordion-section is open and when click button again ...
0
votes
1answer
30 views

How to create a Lightning Web Component using Visual Studio 2015 [on hold]

I need to design a Lightning web component in Visual Studio 2015 and not Visual Studio Code.
0
votes
1answer
39 views

Update value of picklist in LWC

I am pretty new to JavaScript & LWC. I have two picklists that I am using to filter results. The filters are working independently of each other. I have two questions: How could I set the value ...
0
votes
1answer
37 views

Whats the difference between this two @wire? why cant I handle the response without break

THIS CODE WORKS OK: @wire(getPagedContactList, { objectToDisplay: '$objToRender', nameSearchKey: '$nameSearchKey', maxNrRecords: '$maxf', pageSize: '$pageSize', pageNumber: '$...
2
votes
0answers
36 views

Highlight modified fields in LWC

I have a complex UI that renders multiple <lightning-input> fields. When the user edits these fields, I store the originalValue (usually passed through an @api property), the newValue and the ...
-1
votes
0answers
11 views

is there a way to make only parent note open in lightning:treeGrid?

I want only one parent record to be open in a table is there a way to expand/collapse a specific row from the controller ?
0
votes
1answer
52 views

A button to scroll at the top of the page in LWC

Below Playground I have code with the button to scroll at the top of the page and conditionally render the button when user scrolled down. Now if I remove the custom render thing then button works as ...
0
votes
0answers
25 views

Update a custom component with standard component events

Can we listen for standard or toast events on LWC with a pubsub e.g. for the purpose of using a standard component to update a custom component?
0
votes
0answers
28 views

Cannot get ag-grid working in Lightning Web Compnent [on hold]

I am trying to get ag-grid working in LWC. I have gotten other 3rd party libraries such as Full Calendar working. I created static-resources as described in docs and following samples from lwc-...
2
votes
1answer
43 views

How to setup Custom LWC Wire Service

We are trying to normalize our LWC code. Part of that is looking at moving our third-party api's into wire services. I've seen some example of how to setup a custom wire service of OSS lwc but have ...
1
vote
1answer
48 views

LWC is it Possible to Load the JQuery Plugin Datatables in a Lightning Web Component?

Edit: Solved! I'm struggling to load the infamous datatables.net jQuery plugin into my Lightning Web Component. Even using the most basic example, I haven't had any luck. It seems like there are a ...
0
votes
0answers
24 views

Datatable Column action check mark not updating when using Header-Level Actions and @track columns

I followed documentation for "Creating Header-Level Actions" (https://developer.salesforce.com/docs/component-library/bundle/lightning-datatable/documentation) The actions fire ok but I am having ...
5
votes
1answer
73 views

Real time updates shown on record fields without user refresh

I was wondering if there is any way to show a real time update by a callout which fires, let's say an async method called from a trigger. Scenario: User updates something on the account record ...
2
votes
1answer
60 views

Use of export default for class in LWC

I am new to LWC. If in an interview I am asked, Why do we use export default for class in LWC JavaScript?. What do I answer? Is it done to make the component available for deployment to salesforce? I ...
0
votes
0answers
25 views

Rich content field not displaying in LWC

I am trying to display the content of a rich text field in a LWC. Nothing is displaying. Below is my code: public with sharing class ProjectController { @AuraEnabled(Cacheable=true) public static ...
-1
votes
1answer
36 views

Salesforce LWC Pass variables from parent to child and use them in .js dynamically without hard coding field

I have a generic LWC component that provides a lightning-datatable. This component has an attribute @api compareThis = ''. This LWC component is child to a Aura Component. So from Aura component I ...
2
votes
1answer
44 views

Adding custom css to only one lightning input in LWC [duplicate]

Not a duplicate question, Question is 'how to apply custom css to only one lightning input without affecting css of any other lightning input elements. I am trying to apply custom css to lightning ...
0
votes
0answers
16 views

Slds-scrollable not working on IOS devices with Lightning Web Component [duplicate]

HTML template <div class="DataCollection"> //content.................................. </div> CSS .DataCollection{ height: 100vh; width:100%; padding: 15px; ...
3
votes
2answers
73 views

How to detect if a page scrolled in LWC

Please suggest a way to check if a user scrolled down. as of now I have only the below way but only provide scroll count instead of the direction. connectedCallback() { this.count = 0; ...
3
votes
3answers
111 views

How to control LWC styling dynamically?

I need different widths for my LWC for lightning and classic(lightning out) as my LWC is shooting out of card width in lightning. I am able to know whether a user is in lightning or classic using ...