What's the deal with Deno? We talk with a major contributor to find out. Listen now.

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
2answers
59 views

Popping up a modal on a LWC makes contents scroll to top

This is a part of the HTML of my LWC: <template> <div class="slds-grid slds-grid_vertical"> ... <lightning-datatable ...> ... </div> <template if:...
-1
votes
0answers
32 views

slds path scrollable in lwc

html <template> <!--only when data is available display stage marker--> <template if:true={enableStageMarker}> <p class="slds-var-p-around_x-small">...
0
votes
1answer
30 views

Why can not get the data item on the li onclick event?

Work on LWC. Why I can not get the data item on the li onclick event? <template> <li role="presentation" key={item.key} class={itemClass} id="ms-list-item" data-id={...
0
votes
0answers
35 views

lightning-datatable Pagination issue in LWC

if I select row 2 in the first ten records and click next it automatically selected the row 2 on the next 10 records. Still facing the issue when I used the max-row-selection tag in the lightning data ...
0
votes
0answers
12 views

row number column not appearing in lightning-datatable

Row number column is not showing on UI: Here is my code: HTML <template> <div class="slds-p-left_x-large slds-p-right_x-large"> <lightning-card class="slds-p-left_x-...
0
votes
1answer
34 views

Formatting SLDS Modal footer CSS issue in Lwc

I have used the SLDS Modal and added Lightning Record Edit form inside the modal in lwc. The Lightning record edit form with modal it is not in the proper footer. I need to CSS style on it. Current ...
0
votes
1answer
1k views

LWC setCustomValidity on lightning-input-field

I'm using a <lightning-record-edit-form> with <lightning-input-field> children. When required fields are not populated, it occurs the standard message "Complete this field". What I want ...
4
votes
0answers
72 views

Is the time-zone attribute broken in lightning-formatted-date-time?

Based on my reading of the documentation that includes statements like this: When using the component to display a date only, without time, include time-zone="UTC" to ensure the correct ...
0
votes
3answers
48 views

Reading Apex enums in LWCs: “AuraEnabled fields cannot be static” when annotating enum with @AuraEnabled

I have a service class with some error types: public with sharing class ServiceClass { public enum ErrorType { ERROR } } And a controller method: @AuraEnabled(cacheable=true) public static ...
0
votes
0answers
32 views

Title styling in LWC

I couldn't style the title to mimic OOB title style. Any suggestion would be very helpful <template> <div class="slds-card slds-box"> <div class="slds-box slds-...
1
vote
1answer
300 views

How to handle standard toast events in LWC

For lightning I used a handler for force:showToast event to capture toasts for edit/new actions on standard pop up when a record was edited/inserted. I would like to do the same in lwc. I added a ...
0
votes
0answers
9 views

z-index is not working to ensure element is on top

I am building a checkbox dropdown list component and for whatever reason I cannot seem to get the styling correct so that the dropdown list shows above other elements on the page. See screen shot, ...
3
votes
2answers
424 views

Increase Modal height dynamically LWC

I've added some if conditions in the below Modal example however when the content is rendered I'd need to scroll the Modal down. https://www.lightningdesignsystem.com/components/modals/ Is there a ...
0
votes
0answers
12 views

LWC multiple handlers range slider?

Is there some easy way we could implement lightning-slider as a multi-handler slider? I would like to create a range input that has two or more values inside it. As far as I searched, it seems like ...
0
votes
1answer
406 views

LWC Jest Test - Why i keep receive 0 in my Test

I'm trying to make unit test with Jest for my lightning web component. I'm trying to check if the data binded in my html are rendering correctly. It seems like when i'm running the test, it doesn't ...
1
vote
0answers
36 views
+50

'No component definition' warning for LWC even though I defined the component on VF page (Lightning Out)

I am using Lightning out to display LWC on VF page. I have included the definition of LWC on the VF page. Even then, my LWC loads very slowly on the VF page and I get the following warning in the ...
0
votes
0answers
15 views

How to make text in a cell in lightning-datatable clickable ? Not entire column [duplicate]

I have requirement to make text in a cell in a column clickable based on condition in lightning-datatable For example: N/A should be plain text but next one should be clickable with just label S-...
0
votes
1answer
20 views

Can we assign the lightning-output-field value in a property in JS LWC? [closed]

Is it possible to assign a lightning-output-field value in a property in JS? As per my understanding we don't have "value" attribute for lightning-output-field so how to get the value in JS ...
0
votes
0answers
32 views

Compatibility of using Syncfusion JS Component in LWC

I am using trail version and checking the compatibility of using a 3rd party UI component with Salesforce such as Syncfusion. Yes, I am aware that we can use 3rd party libraries but we want to check ...
0
votes
1answer
31 views

Unable to insert an image in a custom object via Apex code

I am working in Lightning web components. HTML <template> <lightning:card> <lightning-file-upload label="Attach receipt" name="...
0
votes
1answer
27 views

Import/Load CSS or JS file from File Attachments instead of Static Resource in LWC

I have different css files for each record, which will be stored as a file(ContentVersion). I want to load that css in lwc. But getting this error. Refused to apply style from '' because its MIME type ...
0
votes
1answer
16 views

Purpose of for:index in LWC?

If I execute below code then {index} starts from 0 but I want use this as a sequence number whcih should start from 1. <template for:each={array} for:item="product" for:index="...
0
votes
1answer
29 views

How do I get the selected value from a Select dropdown list?

Here is my code snippet <select class="slds-select" > <option value="Select">Select</option> <template for:each={options} for:item="option&...
0
votes
1answer
21 views

Apex controller and Salesforce profile access controller

my scenario is that I had a lightning aura component which displays the name of the account.What I'm trying to achieve is if the user is System Admin, he can see the apex return account name. If the ...
0
votes
1answer
15 views

LWC Child Edit Form on Parent RecordPage

Currently in working on Parent record page where child Form will be displayed . Both are custom object. I used Edit form. However it is not displaying any data. Backend SOQL working fine. Do I have to ...
0
votes
2answers
22 views

LWC unable to pass CSS attributes using targetConfigs

I have a simple LWC component where I want users to define CSS using designer attributes. However, it doesn't seem to pick it when I load it on the page even though console logs are picking up the ...
0
votes
1answer
48 views

Cannot deploy flow, Getting error 'Screen component 'ComponentName' is missing a type mapping 'T'

I have created a flow screen component that work for multiple object. In the flow, I have created a collection variable. I have created an LWC component that uses the collection variable. When I try ...
0
votes
1answer
824 views

Send JSON Object data in window.open in LWC Salesforce

I am trying to send the below JSON object in Window.Open, but when i trying to retrieve it, i am getting "[object Object]" How i can get the actual values at receiving LWC end. @track ...
0
votes
4answers
810 views

LWC Data binding in dynamic form (with template for:each)

I face an issue with data binding in LWC if I want to use dynamic form. Let's say I have html like this: <template for:each={data} for:item="item"> <lightning-combobox key={item....
0
votes
2answers
21 views

LWC: remove tags from HTML (view)

JS openModal(event){ let modal = this.template.querySelector('[data-id="modalUI"]'); modal.classList.remove('hide'); const searchKey = event.currentTarget....
0
votes
1answer
22 views

Values not getting populated in custom picklist

I have created a custom lightning page using Lightning web components, having a custom picklist in it, and I am trying to populate the values in the custom picklist on the click of the custom lookup ...
0
votes
0answers
14 views

Updating Duplicate files in Files Related list in apex Salesforce

I have a requirement that whenever user uploads any file from the Files related List, it should insert only unique files. For example: Let's say, that I want to upload a file with the name 'sample.pdf'...
0
votes
1answer
32 views

Multiple instance of child component does not function the same in For:Each in LWC

I have a lwc in which I have a lookup field and pick-list field, where lookup field is a child component and pick-list field is standard lightning-input. Here's the screenshot of the UI: Problem is, ...
1
vote
1answer
49 views

LWC: @wire inside method (function)

I need to run this @wire on a click event. I thought on creating, inside the LWC class, a method to call it, but it didn't work. how can I call the WIRE service inside a function with parameter? ...
0
votes
0answers
11 views

CSS from parent to child [duplicate]

I have parent lwc component and nested child components which have the same custom styling. I want to create css in the parent and use these classes in the child components. How can I do it?
1
vote
1answer
61 views

How to modify a wired result in a getter?

I have a wired function in an LWC that populates an array (records) on success returning an address for each array value. @wire(searchSomething, { searchSomething: '$searchObject'}) wiredContacts(...
0
votes
2answers
21 views

LWC Error on getting picklist values for specific recordTypeId

I'm getting an error every time I edit the Lightning Page layout. I'm not sure where or what I need to add to resolve it. I've done some googling and it's obviously related to something not being ...
20
votes
2answers
4k 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 ...
1
vote
1answer
17 views

Using Brand Theme Colors Within Lightning Components

we are attempting to style a few attributes of our LWC with colors from the active Branding Theme (not community themes). We're debugging our way through this. Also not finding much in the way of ...
37
votes
7answers
14k 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 ...
0
votes
1answer
11 views

Way to give context to a JSON.parse reviver?

So I am formatting data inside JSON Strings and I need to use my application context (like this.name etc.) INSIDE the reviver. Code example of reviver: formatReviver = function (key, value) { if(...
0
votes
0answers
10 views

Placeholder on Rich input text area not updating

I have a lightning-input-rich-text in my component to which I set the placeholder text based on some conditions. The first time the component renders, the placeholder is shown as expected. After ...
0
votes
0answers
16 views

Unable to find sfdx-project.json file even if it is present in VS Code salesforce

I just cloned a remote repository from Git and opened it in VS code. I see sfdx-project.json file present, but still whenever I am running SFDX command it is giving the error saying sfdx-project.json ...
2
votes
1answer
1k views

lightning-record-edit-form component used in Community returns error: “The requested resource does not exist”

I have created a lightning web component as a form to insert new cases. I use this lightning web component inside a lightning community. Inside my lwc I am using the lightning-record-edit-form ...
0
votes
1answer
23 views

Call function from html - LWC

I have datatable with a lot of different values from fields and I need to calculate and show these values in datatable. I have getters for now which call function. Is it possible to call this ...
1
vote
0answers
34 views

Confused about promises and then

In my LWC JS controller, I have code like this: a() .then(() => { this.b(); }) .catch(error => { // error handling }) .finally(() => { // some other code }); Where a is an imported ...
0
votes
0answers
25 views

Best Way to Auth Against Microsoft Graph

I'm building a LWC/Apex component, that heavily utilises the Microsoft Graph Outlook API. I currently have it set up (still in development) in the way, that for every request I make to the graph API, ...
0
votes
1answer
20 views

querySelector returns null, how to reach a div inside another template?

I have the following HTML file for a LWC (details omitted): <template> <div id="main-div"> ... (A) </div> <template if:true={xyz}> ... (B) </template> &...
0
votes
1answer
27 views

Unable to apply filter on a custom lookup field, on the click of another custom lookup field

Project and Unit in a Master-detail relationship Project-Master object Unit - detail object Price - another custom object Price contains two custom lookup fields Project, Unit I have created a custom ...
0
votes
0answers
31 views

Getting “This org appears to have a problem with its OAuth configuration. Reason: invalid_grant - expired access/refresh token ” error in VS Code SFDX

From today, Suddenly, I started getting the below error in VS code whenever I am running any SFDX command: ERROR running force:source:retrieve: This org appears to have a problem with its OAuth ...

1
2 3 4 5
73