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
6 views

Close opened popup using .blur or .focusout methods in LWC

I am opening a new window using window.open & wants to close it via onblur or onfocusout. However, none of them is working. let newWindow = window.open("https://www.w3schools.com", "_blank", "...
0
votes
1answer
31 views

LWC: Maximum Blob Size From JS To APEX

I want to make a "custom file upload" LWC component as I am in need to build a specific design for an upload process. There are a few things I am not sure about. What would be the maximum size of a ...
2
votes
2answers
36 views

Time conversion LWC datatable - Apex

I have two Time field in my Custom Object Start Time and `End Time Start Time Value ==>8:30 AM End Time Value ==>6:00 PM From Apex Wrapper class I'm returning the time values. @AuraEnabled public ...
0
votes
1answer
24 views

How to make a callout using LWC in salesforce?

I am very new to LWC in salesforce. I wanted to understand how to make a callout using LWC.
2
votes
1answer
26 views

Display fields horizontally in LWC

I have a few lighting-combobox fields that are used as filters. I want to spread them across the page horizontally. I was trying to use a with each filter in a lighting:layoutitem. I looked at the ...
1
vote
1answer
25 views

Is there any Lightning Container Component for the Lightning Web Components framework?

I am about to kick start a project that's gonna make use of the Lightning Container in the Lightning Aura Framework. Q: Is there any LWC counterpart for this aura component? From the documentation ...
0
votes
0answers
24 views

Lightning Web Component Jest testing

Hi I am trying to test my child component from the Jest test for that I am trying to fire an event but I am getting an error. Code In Jest: let aBCL = element.shadowRoot.querySelector(a-b-list-k'); ...
0
votes
0answers
13 views

List declaration for sObject on target config property Lwc

So I have this component where I want to create a @api accesible variable containing Cases instead of Strings I was using, to be accessed from a visual Flow. The whole thing was running smooth with ...
0
votes
1answer
21 views

Override Action with Component in Lightning Console as overlay or modal instead of a new tab

From a list view, either by overriding a standard action or by using a list button, I would like to open my lightning (currently using aura) component in a modal dialog instead of a new tab in the ...
0
votes
1answer
33 views

How to add variant icon in a Lightning Datatable in a LWC

I have the column in the data table which will display the "utility:success", Based on the condition my controller will return the selectedIcon value and display the icon as below. Now I', trying to ...
0
votes
1answer
38 views

LWC Display a field based on the selected parent record

On a new form, I have a master-detail relationship field <lightning-input-field field-name='contactrel__c' onchange={handleContactChange}></lightning-input-field> {DoNotCall} I would ...
2
votes
1answer
20 views

How to add LWC/Aura dynamic App Builder component properties?

I am looking for ways to create Design Properties for an Aura or LWC component so that I can render different values in component properties based on chosen value in one property. Something very ...
0
votes
0answers
14 views

Prevent Visual Flow Screen from Clearing When Clicking Next

I have a visual flow screen with a mix of out-of-the-box and custom Lightning Web Components on it. Some of the OOTB components are marked required and one of the LWCs has a validate() method that ...
0
votes
0answers
35 views

How to add custom lightning web components to communities using ExperienceBundle Metadata Api?

I am trying to add custom lightning web components programmatically on community using ExperienceBundle Metadata API and then deploy it to org using Salesforce CLI. I tried modifying the home.json ...
0
votes
2answers
46 views

How to pass array to apex method in LWC

I am creating custom functionality of Adding opportunityLineItem in LWC. Once I input details and click 'Save' I am not able to pass string value or object value to Apex method. Throwing error. ({"...
1
vote
1answer
19 views

Does the size of a child LWC count towards the size of the parent LWC

We have a LWC that has become too large and is about at it's size limitation, so are going to break it into multiple pieces that all communicate with each other. As I was researching I found most ...
1
vote
1answer
31 views

LWC - Send Property Down to Dynamically Created Template

I have created a small app in LWC where different templates are shown by following this answer. The flipping of the templates works fine, but there doesn't appear to be an obvious way to send data ...
0
votes
1answer
18 views

LWC - Add Select List as filter [closed]

I am working on replacing an Aura component with a LWC. On my Aura I had select fields that were used as filters. I had a function that was called from each filter field that filtered down the ...
1
vote
2answers
51 views

DisconnectedCallback in LWC

I want to do some DML operation when my lwc is removed from the DOM, so can anyone please confirm if disconnected callback will run on all below scenario on close tab. on browser close. got ...
0
votes
1answer
33 views

Failed to save Lightning Component - Value too long for field

I'm getting the following error When I deploy my codebase. It shows Value too long for field: Source maximum length is:131072. I could able to find the solution. Is there any configuration change ...
0
votes
2answers
33 views

Dynamic Id declaration with added text (Id-Text) in LWC

I have a doubt in LWC. Can we declare a dynamic id inside template for:each For the dynamic value, I used the data-set, and using the onclick event got the data-set value. Since I have multiple HTML ...
-2
votes
0answers
24 views

How to set color for selected row in slds table [duplicate]

I have a table with rows, i want to highlight the selected row when it gets disbursal. I used slds color and give it background color, but if it doesn't worked
0
votes
0answers
20 views

Validate approach (Googlemaps)

We have a requirement to create a custom UI using googlemaps. lightning-map wont do what is needed from a customisation POV Is there a way to load an external javascript in LWC if we turn off locker ...
0
votes
0answers
24 views

How to force component refresh in lightning web component

I have a requirement that with the click of "Submit" button i need to call an apex method , if its a success i need to throw success toast message but along with that i need to refresh the component ...
0
votes
1answer
24 views

Slds Button With Icon

I'm using the lightning-button-icon inside the SLDS button.(Reason : to Change the button color). button icon is in grey color variant="container" how to change the forward button color to white. &...
0
votes
1answer
15 views

How to override LWC lightning record form Cancel button

I'm using a lightning record form to create a new cord in a Customer Community. Just wondering is there any way to override the standard 'Cancel' button behaviour?
0
votes
1answer
19 views

How to call one function from another function in same javascript file in lightning web component

If there are two javascript methods A() and B() in same LWC component, is it possible to call method B() from A() where Function A() gets called with click of button? If not what can be the possible ...
0
votes
1answer
40 views

Issue with nesting for:each iterator using LWC

I am receiving an undefined error over my for:each block in my lwc HTML. I am unsure why QuestionChoices is undefined as it's a key on the surveyQuestion object. Parent Component: surveyQuestions ...
0
votes
2answers
26 views

How to redirect to another page on double click of row in lightning-datatable LWC?

I want to redirect to another page on double click of row in lightning-datatable, i have tried to add double click listener to lightning-datatable but it does not work. Could you please provide any ...
0
votes
1answer
35 views

Display icons in Lightning-tab along with labels in LWC

Can we display icons along with labels in lightning-tab in LWC. In Aura framework we can do using below code : <lightning:tab > <aura:set attribute="label"> First Tab <...
0
votes
0answers
28 views

Cannot Query RecordType field on a custom object via lwc component [compilation error]

I'm trying to do the below SOQL from an lwc component, SELECT Id, RecordType.DeveloperName FROM CustomObject__c TEHN when I try to recompile the lwc component I get the below error. Once I remove ...
0
votes
0answers
21 views

LWC with region to accept build-in Salesforce component

I'm building our own navbar and hero container as LWC. The navbar should have an authentication element so I would like to be able to drag-drop a build-in component to it eg. User Profile Component or ...
0
votes
0answers
18 views

Cannot find module '@jest/globals' from 'abc.test.js'

Has anyone encountered this kind of an error? We had a bunch of jest js files that were working a few months but now are failing. Can any JEST experts help?
1
vote
1answer
58 views

The use of FlowAttributeChangeEvent in LWC

I have a lwc which is used in a flow. I have several variables from the lwc that are exposed to the flow. I need to make the flow know when these variables changes, so according to documentation I ...
3
votes
1answer
49 views

What is the simplest way to offer “change password” in a Community?

In the Community Administration Login & Registration, there is a "Reset Password" page option that offers: Default Page Visualforce Page I would like to expose the "Default Page" in my community ...
0
votes
0answers
36 views

How to Get the IP address from the Site - Guest User

I have a LWC public site which has Input form Email, Once Email address is enter will send an link to Email to the Give Email Address.(This is done and Working) To Prevent the junk data, Trying to ...
0
votes
1answer
28 views

overflow LWC tabs to scroll horizontally

When we click on the more button the remaining tabs are coming vertically instead I need to achieve horizontally So if i click on the arrow in right tabs have to move horizontally. Is there a way we ...
5
votes
3answers
242 views

Cusom Lwc in Flow not returning value, summer 20

I am using custom lwc to capture data about selected checkboxes inside flow. It was working properly until summer 20 release. Now it does not return any value. @api get result() { return this....
3
votes
0answers
83 views

LWC-base-components-recipes issue, Summer 20' release, assert.js

I am using textarea base component, this had to go with lots of other dependencies to my org. Unfortunately after summer 20' release I had to comment out code in assert.js today: export function ...
0
votes
1answer
36 views

Adding a lwc component to standard New record popup

I have a custom lightning component which I need to include when creating new records. What I need to do is add this custom lwc component to the standard New popup, which shows when clicking the New ...
0
votes
0answers
20 views

Jest To call pubsub by method [closed]

i need to write the unit test of the method which is calling pubsub in the current method can anyone tell me the correct method to write the test method gentleError(event) { errorwithpubsub(...
0
votes
1answer
55 views

Lightning web component validation

I have a datatable in a LWC where I allow users to update fields from the record. I am trying to add validation during save(or does the datatable have its own validation) to make sure 1 field value is ...
0
votes
0answers
82 views

lightning web component datatable create new record

I have a lightning web component wrapped in an aura component. When the user selects the quick action it renders a datatable of the child records(po lines) Right now if if a user selects more than 1 ...
0
votes
0answers
20 views

Passing a string in json format from visualforce to lightning

I have a Visualforce page and have embedded an lwc component into it using lightning:out. The lwc component is just a form that is based on an object. I need to default some fields in the lwc ...
0
votes
2answers
40 views

Use HTTP Response Body in Wired Apex

I am trying to do the following: Called an HTTP Get method from Wired Apex The callout will return an array of objects Return response.getBody the wired method. Parse the response and display in a ...
0
votes
0answers
32 views

Iteration in LWC not working for 2nd element of input array

I am working in LWC requirements where I have a list of records using this list I need to create inputs text. Once I loop through the list in LWC 'HTML component' my input texts are coming as aspected ...
0
votes
1answer
35 views

LWC Datatable not returning data

I am trying to perform the following: Create a lwc that will render related records in a datatable: Make LWC available for quick action. So basically have a QA on the Parent record that when selected ...
0
votes
0answers
15 views

Running into setup issues with JEST (TypeError: Cannot read property 'extension' of undefined) [closed]

Running into error at this line - "document.body.appendChild(element);" in: const element = createElement('c-dec-template-document', { is: DecTemplateDocument }); document.body.appendChild(...
-2
votes
0answers
27 views

I need add colour for particular row in lwc data table [duplicate]

Have tried by defending the class fieldname and called with failed name by assigning colour slds class:{filedName:'t1'} item["t1"...
-1
votes
0answers
40 views

Lwc data table to add color for particular selected row [closed]

Like this only i need only when disbursal is there in table it should colored with red.please there is resolved solution.

1
2 3 4 5
56