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
0answers
15 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-...
-1
votes
0answers
34 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
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, ...
0
votes
0answers
38 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

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
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
0answers
34 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-...
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
35 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
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
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
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
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
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
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'...
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
1answer
23 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
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?
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
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 ...
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
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
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 ...
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 ...
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, ...
1
vote
0answers
35 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 ...
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
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 ...
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
32 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 ...
0
votes
1answer
31 views

How to call public method of sibling component LWC

DO i need to use message Channel to call public method of sibling components?
0
votes
1answer
36 views

Creating custom dependent picklist field in LWC

I have a picklist field which I am fetching using wire. Now the scenario is I have to fetch all the records of the selected picklist value and show the values of one of the field in records in another ...
1
vote
1answer
30 views

LWC: Is it possible to store part of the schema string to import in Custom Metadata

I want to store the fields that need to be imported from the schema in my LWC in Custom Metadata. So for instance I want to make the following line dynamic: import MY_OBJECT_ID_FIELD from '@salesforce/...
2
votes
1answer
26 views

Best practice for distributing LWC lightning app in managed package

I am distributing a managed package which includes a lightning app built with LWC. In my dev org I needed to enable My Domain to get it to work. I've tested installing my package on an org without My ...
-3
votes
0answers
44 views

How to do EDIT and VIEW the record in datatable in lwc? [closed]

Row action in lightning with View and Edit record in lightning datatable in lwc.If I need to edit there record by using apex because of Look relationship with two objects I need to take record id and ...
0
votes
1answer
34 views

LWC querySelectorAll is not working

I am trying to iterate Student name as a button on click of button i need to show the students details below. For this, by default i kept the button class as slds-button_neutral on click of any of the ...
2
votes
1answer
33 views

Unable to call apex method using wire service, returning the result as [Object][Object]

<lightning:card> <lightning-button variant="brand" label="New Entry" title="Open Modal" onclick={openModal} class="slds-var-m-left_x-...
0
votes
1answer
22 views

Geeeting particular value from json and store in one variable

I need to get a particular value from the JSON and store it in the variable in LWC is there any way I can do it: asd==[ { "ABC":"ytyffy98948", "custui":&...
-1
votes
1answer
30 views

LWC returning array

Hi i need to search and filter out all the values from the array with the help of the user input as a key , i am trying to use filter but not getting anything kindly help me out: this.valueFromUser='...
0
votes
1answer
26 views

LWC HTML not rerendering after object change NOT Solved

I am having a similar issue as the one linked at the bottom, it looks like the answers are claimed to work, however I cannot seem to figure out wth is wrong with my code that seems to be very similar. ...
0
votes
1answer
13 views

LWC - Alternate Button Icon in lightning-datatable based on results

How do I conditionally alternate a button icon displayed through a lightning-datatable? I would like to change the button icon based on data coming from the Apex method? The AccountContactRelation....
0
votes
1answer
15 views

getting value in Javascript from HTML [closed]

Hi I need to obtain a particular table value from UI HTML to Javascript: kindly help me out Here is my HTML: <template if:true={cOopyu.Acc}> <div> <a href='javascript:void(0);...
1
vote
1answer
24 views

Dynamically update get property value in LWC

Scenario: I am passing an array from parent LWC to child LWC and looping over it in child component. In child LWC, when a button is clicked, I am trying to add an item at the beginning to the array, ...
0
votes
1answer
24 views

LWC: CallBack list doesn't show on lightning-layout

I want to make a LWC which input keywords and show the results on list using lightning-layout & lightning-layout-item. And I want to make it that doesn't depend on SObjects. Now, I have a problem ...

1
2 3 4 5
73