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
5
votes
0answers
15 views

Can I use wire adapter in classes that do not inherit from LightningElement?

Is it possible to use @wire in classes that do not inherit from LightningElement? Example: export default class A { @wire messageContext; } What I want to achieve: I want to create a ...
0
votes
0answers
8 views

Is it possible for SLDS-Backdrop to gray out only current tab and not the entire screen?

I am using SLDS-Backdrop CSS to gray out the background while a progress bar runs. This CSS class grays out the entire screen till the progress completes itself, which the business doesn't want, as it ...
0
votes
0answers
4 views

Sort columns on multiple lightning datatables separately

I have multiple datatables that I am trying to sort columns on separately. When I click on the column of one table to sort it, the same column on all datatables is being sorted as well. datatable.html ...
0
votes
0answers
13 views

Lightning Web Component Open Source

When I try to create the project with lwc oss it comes to nothing, stops at the attached image part and does not progress. Do you know why this could be the problem?
0
votes
0answers
9 views

API Call Button Not Functioning On First Click or Two

I am currently working on a simple project for a client that wants a tool to calculate the rates they will charge for shipping. It takes two user-input address, makes a distance matrix API call on ...
0
votes
0answers
10 views

How to Hide a lightning-input-field on a Lightning web component

I am creating a lwc with three files. A .html file, .js & a .xml file. I need to hide a then have a validation that will not submit the form if that field is filled out. I need some help writing ...
5
votes
1answer
193 views

What is Lightning Web Security (LWS)?

Salesforce has just announced a new Beta feature in the Winter ’22 release notes: Lightning Web Security. What is this exactly?
0
votes
1answer
13 views

How to start using Dual List Box from Lightning with Dynamic Data from different Objects

I'm working on a dual list box, the left side contains Queues from the ORG (queues where the selected user doesn't belongs to) and the right side has Queues from the User(queues where the selected ...
1
vote
0answers
23 views

UserManagement.initVerificationMethod not working in Apex

The following function doesn't work for me and throws this error: System.NoDataFoundException: User does not have Salesforce Authenticator pairing The goal is for me to create a custom login LWC for ...
0
votes
0answers
10 views

How to iterate using custom table and for:each for active campaign related list in lwc [closed]

Related List Active Campaign in lwc. I am currently having problem using tables when getting active campaigns in custom table and not in datatable. Because I want to make the design similar to ...
1
vote
0answers
23 views

LWC Input Address not populating Province

I'm trying to implement a standard lwc input address https://developer.salesforce.com/docs/component-library/bundle/lightning-input-address/example. When I search an Italian address the province field ...
0
votes
0answers
15 views

how to view the sibling component in lightning app page?

I have 2 unrelated/sibling components which on the click of a button on the 1st component it should take me to another component. As they are not related to each other i want to know how can I want to ...
0
votes
0answers
15 views

How to send messages(messagecontent) over chatbot automatically through JS or apex?

I have a community builder on which I have embedded a chatbot, I have created an LWC component where the Javsacript controller extends baseChatMessage. I would like to send an auto message to the ...
-1
votes
0answers
13 views

While working with Bulk API using V 2.0 using apex, get job details in same transaction [closed]

I have been working on creation of custom data loader, where user will upload csv file containing records. Then click on submit which will upload records to system. We are using LWC for UI and Bulk ...
0
votes
0answers
18 views

How to show remaining character count through lightning-input-field in LWC

I am using lightning-record-edit-form to design a form layout for creating records and saving the value in custom Object fields and using lightning-input-field to provide the input. The maximum ...
0
votes
1answer
21 views

How to dynamically change a CSS class based on apex attributes

HTML: <template> <lightning-card> <div class="container"> <template for:each={Opportunitys.data} for:item="Opportunity"> ...
0
votes
1answer
24 views

How to get the uploaded file's size when using lightning-file-upload?

I've tried the following but it returns 'undefined. event.detail.files[0].size
0
votes
0answers
17 views

LWC lightning-datatable - get multiple record Ids [duplicate]

I have the following datatable and on the click of a button, I would like to get all of the record Ids to put in a list. However, when I try the method below I am getting a proxy object. I know this ...
0
votes
3answers
34 views

Wire Connector Returning Property Undefined

I'm new to development, and using an LWC component with an Apex class for the first time. I have written an Apex Class that seems to function as expected when tested, but I'm running in to issues ...
5
votes
1answer
242 views

Is a headless daemon LWC a good pattern?

I want to write an LWC that listens for a small set of LMS messages, performs database operations sometimes and sometimes forwards new LMS messages for the benefit of another LWC that may or may not ...
0
votes
0answers
22 views

How To Write Query To Display RelatedList Records in inline datatable

I'm just trying to display the related records of custom object in inline data table. public with sharing class Offtake_Display { @AuraEnabled public static List<SBQQ__Quote__c> ...
0
votes
1answer
25 views

How can I select More than one option from different radio group buttons in LWC?

I want to select options from Radio buttons from different groups of buttons. I am only able to select only one option from all Radio button groups in the component. in the above example, I want to ...
0
votes
1answer
18 views

Can lightning:datatable menu items be hidden for particular rows?

I know that it is possible to dynamically set menu items per each row of lightning-datatable, but I have a requirement to completely hide the action menu items for the particular rows which satisfy ...
0
votes
1answer
43 views

LWC issue in binding the lightning combo box

I am using LWC in a screen flow. I get a response from an API and need to bind that value in the lightning combo box. It's in the JSON array format. Here is the code. JS import { ...
0
votes
0answers
31 views

Add color to custom lightning datatable header [closed]

Color is not adding. Please let me know where I am doing a mistake. <div class = "myTable"> <c-custom-type-component class="POdataTable" key-field=&...
0
votes
1answer
42 views

Override localstorage.setItem method LWC

I am trying to make the localstorage.setitem(key,value) method dynamic to do some custom stuff. But it doesn't seem to work? Is this supported in LWC framework? Here is my HTML file <lightning-...
0
votes
1answer
20 views

Remove the Validation and Error message from Lightning-input field on Focus

I am using the Lightning-input field which is required field. When I leave the field empty it shows a validation error. But the error stays there till I give some input and click outside Is there any ...
0
votes
0answers
42 views

LWC Quick Action Not Reopening after getting closed

I have created a quick action to open a lwc page, and I have used slds-modal instead lightning-quick-action-panel, for a better look and feel. And then I have used CloseScreenEvent when the close on ...
0
votes
1answer
34 views

How to create dynamic URL for a list of records in LWC

I want to create dynamic URL for list of records in LWC component. Scenario: I'm showing a list of opportunities based on the stage (closed won) in layout using LWC. When I click the opportunity name ...
0
votes
1answer
52 views

How to display nested JSON data onto Lightning Web Component

I have built a small form, based on input data I am hitting a service and getting results in the form of JSON. I am trying to display below nested JSON data onto UI data table using Lightning Web ...
0
votes
0answers
15 views

Profile image url of current user

I have a custom object Employee__c which has lookup on User object. I have a requirement to get the associated user's MediumPhotoUrl field value to display the image in my lwc component. I am using ...
0
votes
0answers
19 views

How to render records for multi checkboxes in LWC [closed]

I have two checkboxes acts as the filter in my LWC. I want to render records based on the checkbox checked. If both of those are checked or not checked, all the records must be displayed. If either of ...
0
votes
1answer
60 views

Can we change background color of a disabled button in lightning web components

Example: I understand we can achieve by using slds button base component but any other way directly to achieve through lwc. <lightning-button label="Neutral" title="My Title" ...
0
votes
1answer
27 views

Space between card header & lightning-datatable

maybe you know the problem that there is a white space between Card Header and a lightning-datatable. You can see it on the screenshot. Do you know how to get rid of it? Here my Code: <article ...
0
votes
1answer
32 views

Render Child Component again with a Change on Parent

I am trying to do display some data in the child component from Parent Component where my parent Component has an object variable that am using to display on my child component. Here's Simple Snippet: ...
0
votes
1answer
25 views

Get parent record fields using getRecord uiRecordApi in lwc

I'm trying to get parent record value using uiRecordApi in my lwc component. But I'm getting error. Cannot read property 'value' of undefined import OPPORTUNITY_ISCLOSED from '@salesforce/schema/...
-3
votes
0answers
21 views

How to add LWC in quick action [duplicate]

<targets> <target>lightning__AppPage</target> <target>lightning__RecordPage</target> <target>lightning__HomePage</target> <...
0
votes
1answer
40 views

Update returning undefined

I'm trying to learn to code in Apex and LWC for fun, but I'm having an issue here that I've been able to understand why: Apex class @AuraEnabled(cacheable=true) public static void sellItem (String ...
0
votes
0answers
24 views

lwc open source mobile apps success stories [closed]

I'd like to know some sucess stories (I refer web sites or mobile apps)using lwc.oss with node.js, I could't find any clients using this techs. Thanks!
0
votes
0answers
40 views

How to change styles of one element in a array in LWC [duplicate]

I want to change styles of one element that I received from an API, when I render it, I need to change styles for example of the second element displayed, like a font-size bigger or italic etc, any ...
0
votes
0answers
34 views

LWC custom file upload error

I have a custom form built with LWC. In the form it is possible to upload multiple files. Due to styling requirements the standard lightning-file-upload cant be used and I am therefore using the html &...
0
votes
2answers
40 views

lwc navigateMixin specify fields

In my LWC component js file I have this code: handleStudentSelected(event) { const defaultValues = encodeDefaultFieldValues({ Tutor__c: this.tutorId, Student__c: event....
0
votes
0answers
18 views

Web-to-Lead in LWC taking the label, not value, of a Lightning-combobox

HTML: <lightning-combobox options={countryOptions} name="country_code" id="country_code" value={countryValue} onchange={handleCountryChange} label='Country:' validity="&...
0
votes
1answer
17 views

How to override standard slds class for textarea in lwc

I have a textarea field in my LWC. I'm trying to set height for the textarea but no luck. <lightning-textarea name={record.id} class="slds-p-horizontal--xx-small" variant="label-...
0
votes
1answer
28 views

Display HTML in a Toast Popup Alert

Is there any way to display HTML in a Toast popup? I'd like to display a list of error messages, and not just a single string.
0
votes
1answer
37 views

How can i test my Apex method

I am not sure how to write test class for this method. Any help would be greatly appreciated! @AuraEnabled(cacheable=true) public static List<Map<String, String>> getPickListValues() { ...
1
vote
1answer
35 views

Understanding LWC without APEX?

I made a post under the title a few days ago called "Conditional Rendering of a Form Based on Case Status LWC (if:true)" In that post I talk about how I am trying to set an attribute to the ...
0
votes
0answers
22 views

Why is my second gauge chart not being rendered?

I'm trying to clone the Target Gauge Chart (left) to create the Target Spex Gauge Chart (right), but this is happening: Even if/when isTargetSpexInitialized is true, the right graph is not displayed. ...
1
vote
1answer
33 views

Clear Only Row-Level Errors in Datatable

I'm trying to do datatable error-handling using the built-in errors attribute. For the sake of example, let's say I have a datatable like this: <lightning-datatable columns={columns} data={...
0
votes
1answer
41 views

How to wait for a chain of wire adapters to settle before running some logic?

I'm trying to get the timing of some setup code in an LWC to be reliable. The code needs the opportunity record type Id so it can get the correct picklist values. Then with those picklist values (and ...

1
2 3 4 5
108