Questions tagged [lwc-dom]
The lwc-dom tag has no usage guidance.
195
questions
-1
votes
1
answer
36
views
Can we add a onclick listener to the Sales Path on Opportunity?
The Opportunity Sales Path I'm using is a standard one, and not taking the lwc route to implement the path. Is there a way to listen to any change here by some event listener on my lwc? So far, I have ...
0
votes
1
answer
60
views
Salesforce LWC - State management in checkbox input control
I am new to salesforce LWC. Developing a page with a checkbox inside a component. So my task is to maintain the state of the checkbox even after the page refresh. For this, I used session management ...
0
votes
0
answers
52
views
recordId is blank in imperative call
I have an lwc action button that loads the popup. When i load the component for first time, recordId is present. But when i close and open it again(without reloading the whole page), recordId is lost. ...
3
votes
1
answer
167
views
Can you create a slot that moves in the DOM?
I have a generic component that renders a form in a slot.
I want the layout of the component to be changeable. E.g. move the form from the right hand side of the screen to the top.
The layout changes ...
0
votes
0
answers
28
views
Intra-page links in a Lighting Web Component (LWC) that break because ids are dynamically altered
Salesforce LWCs dynamically change HTML ids to ensure uniqueness. This is creating a challenge for one of our components that dynamically renders an SVG. My question isn't specific to SVGs though. It'...
5
votes
1
answer
140
views
Loading / Destroying Many LWCs
I am looking to see if there are any best practices when developing a large LWC "app".
The main challenge I am seeing is when I want to display a certain "screen" to an end user, I ...
0
votes
0
answers
29
views
Quick Action - Detail Button Page Error - LWC
can anyone help me with this error,
My requirement is:
I have a Detail page button called Convert on Order Object, when I click on the convert button it should convert the order object Record to ...
0
votes
1
answer
103
views
Resizable divs in LWC
LWC playground
https://app.lwc.studio/edit/CTHEQCGrn18rKmQQ0zs1
I have below HTML
<section class="resizeable-container" >
<div class="resizeable-item">
...
0
votes
0
answers
76
views
Issue importing dependent libraries in LWC
I'm trying to create an orgChart in LWC to represent how my objects are set up.
I found the following library to do it : https://github.com/bumbeishvili/org-chart
When looking at the examples, he ...
0
votes
2
answers
90
views
LWC Event to Catch internal Salesforce Navigation [duplicate]
My Question :
Are there any events which checks whether user navigates to which navigation menu right now ?
For Example :
When I am at Case Record Page and my LWC is placed there,
So If I switch to ...
1
vote
1
answer
80
views
LWC Local Server says Couldn't find the custom component when I pass attribute using Custom Event from child to Grandparent
Im trying to do a simple operation which is pass an attribute from child to grandparent in LWC using Custom Event where I set the Bubbles and composed attribute to true to pass it through the ...
2
votes
1
answer
215
views
How to pass the array of values to mult-picklist from LWC to apex
{
"language": "English",
"country": "GB",
"successValidation": true,
"businessEmail": "jena@gmail.com",
"...
2
votes
1
answer
301
views
Adding third party library to Salesforce LWC
I'm trying to create an address search component using Dawa Address library (Danish Addresses) https://dawadocs.dataforsyningen.dk/dok/guide/autocomplete#trin-2-installer-dawa-autocomplete2-...
0
votes
0
answers
145
views
Print a portion of the Lightning Web Page or a single component
I am currently trying to find a solution to a scenario where we need to print a portion of the salesforce lightning page or a single LWC. I have been able to do this outside of a salesforce LWC but am ...
0
votes
1
answer
153
views
Lightning Icon not changing iconName dynamically
In my lwc html I'm using
<lightning-icon icon-name={iconname}></lightning-icon>
In .js setting value in icon-name on any event say platform event,
this.iconname = 'utility:success';
OR
I ...
0
votes
0
answers
35
views
LWC.CreateElement? [duplicate]
I was researching for document.createElement() and could not seem to find anything. Is there any way where I can use createElement in salesforce or any other Alternative as I need to create div ...
1
vote
0
answers
45
views
LwcWebpackPlugin with AliasModuleRecord for lwc.dev isn't loading HTML file for component
I use LwcWebpackPlugin to load Lightning Web Components. Everything works fine but because I want to load compoennts from 'lwc' direcotry the namescape won't work.
I must get components from /lwc ...
0
votes
1
answer
171
views
How to track change on an Account field in LWC?
Whenever I change a specific field (for example Account Name), I want to set a template if:true to false, in order to hide an element.
I'm using @wire to get the account name from the record page, as ...
0
votes
1
answer
69
views
How to update data on unrelated components?
So I have two unrelated components on one page. And when items are added\deleted on the first one they need to be displayed in second component. I use this: eval("$A.get('e.force:refreshView')....
1
vote
0
answers
39
views
Uncaught Reference Error : newAge is not defined throws at "myPlaygroundLink"
The component I wanna create should recieve input from user and update newAge variable that I have defined and should console log it, but when I try to enter value this popup comes with error
...
3
votes
0
answers
170
views
Implementing jstree library with Lightning Web Component
This will be a long one, hoping someone can help.
Problem Summary: I'm unable to integrate the "Drag and Drop" (dnd) plugin functionality with my LWC that utilises the jstree library (https:/...
0
votes
0
answers
63
views
How to get cell changes from multiple lightning data tables with one button outside lightning data tables in LWC?
I have a requirement to edit multiple opportunities and opportunities' lines. For each opportunity, I have 3 lightning data tables (1 for Opportunity, 1 for Opportunity Technology Lines, 1 for ...
1
vote
1
answer
1k
views
Chart Js: How to display data values in chart js bars
I have built simple bar chart with ChartJS version v2.8.0, so now I am trying to display the data values on each bars using chartjs-plugin-datalabels v1.0.0 plugins chartjs-plugin-datalabels I have ...
3
votes
1
answer
191
views
How to sort the elements is lightning-dual-listbox based on the label?
I am trying to sort the elements in the dual list box, unfortunately i did not find any correct way to do it.
This is my html component
<template>
<lightning-dual-listbox name="...
0
votes
1
answer
507
views
LWC jest test on conditional element
How can I test if:true element in my lwc? showLoadingSpinner is @api. I am new to jest, sorry if stupid question. Console log shows null.
<template if:true={showLoadingSpinner}>
<div id=&...
0
votes
1
answer
365
views
How to retain user-input in lightning input field
I created an LWC in which I have 3 parts on a page: (here Allergy & Medication are visible).
1st page has 2 input fields, and to view each part of the page, a boolean variable is used (template ...
2
votes
0
answers
449
views
undefined value from html button value attribute
I am iterating an array in template and on the button click I am trying to get the value of selected element but the value coming is undefined
<template>
<template for:each={pages} for:...
0
votes
0
answers
152
views
LWC Filter contacts
I have the following drawback: my parent LWC shows a list of contacts with their related details. But I need to filter these contacts based on an input, typed in by the user. In this case, the channel ...
0
votes
0
answers
338
views
Dynamic list view in LWC with a combobox
I have this problem:
I have a LWC that shows my contact details. But I want to add a checkbox to filter my contacts based on a picklist field. I'm thinking of doing it in two ways:
Call Apex with a ...
0
votes
1
answer
2k
views
LWC add custom data-type checkbox and extending lightning-datatable
I have a requirement where I have implemented the lightning-dataTable with the custom-dataType column checkbox.
As you can see in the screenshot, I have a requirement where
onCheck of the parent row(...
0
votes
0
answers
169
views
Is it right way to check CRUD Permission in LWC?
import { LightningElement, wire } from 'lwc';
import { getObjectInfo } from 'lightning/uiObjectInfoApi';
import ACCOUNT_OBJECT from '@salesforce/schema/Account';
export default class CheckPermission ...
0
votes
0
answers
97
views
How to access window.ApplePaySession in LWC?
I am working on apple pay integration using LWC. So far, I am able to access the window.ApplePaySession in my safari browser console but in LWC it's showing undefined.
I have also tried with static ...
0
votes
1
answer
808
views
How to select an element inside a template if true in LWC Jest test?
I have an LWC app that has a lightning-input and a lighning-button. It fetches data from the server for a record whose ID is specified. I have successfully mocked the server calls.
I am trying to ...
0
votes
1
answer
503
views
Cannot change or access class member variables from callback function
In the below code, the function dragstarted() is D3 JS function that gets called everytime a graph node is clicked (which gets called fine). However, it is not possible to change 'clicked' or call '...
1
vote
1
answer
443
views
Do something every time an @api property value changes in child component [duplicate]
I am passing a property from a parent to a child component. I am trying to perform a task every time the value passed from a component's parent to itself changes.
export default class displayData ...
11
votes
1
answer
6k
views
Order of execution of @wire in lwc
I know that @wire methods are always executed once our component is loaded. I want to dig deep into this and want to understand the order of execution with respect to the component's life cycle. When ...
3
votes
0
answers
274
views
LWC Responsive Tables In Light DOM
I'm trying to build a div-based responsive table in LWC using Salesforce's new "Light DOM" feature. Unfortunately the table won't render properly, it looks like this:
Following is the html-...
0
votes
0
answers
401
views
jest dom is not updating after element.innerText is set imperatively
I am testing a component that renders a table. Each row of the table body has a column that contains a button, when the button is pressed a javascript handler modifies the cell by setting the ...
0
votes
0
answers
83
views
LWC Could show checkbox group inside lightning-tabset correctly
In order to provide users with a UI in which he could select some products with groups of products based on global category
I am trying to show lightning-checkbox-group inside lightning-tabset, this ...
0
votes
1
answer
615
views
Resetting rich text area in lwc record edit form
I have a lwc
with the following code in html
<template>
<lightning-record-edit-form object-api-name={object} onsuccess={handleRecordCreate}>
<lightning-messages></...
2
votes
3
answers
9k
views
How to use querySelector inside forEach in HTML file of LWC bundle?
This might be super easy but I am stuck. I have a lightning card inside forEach on the template. In Javascript, I need to find the card, and add dynamic css based on some business logic. However, ...
0
votes
1
answer
255
views
Communicating between parent and child which is multiple levels deep
So I have parent component and child components as so
<parent>
<childl1 contracts = {contracts} oncontractsupdate = "handleContractsUpdate">
<childl2 contracts = {contracts}...
0
votes
1
answer
1k
views
Open multiple accordion section using active-section-name not working as expected
i tried to create accordion section dynamically by constructing the section name and the data inside accordion in the JS file. Method in JS will call apex method that will deserialize JSON response ...
0
votes
1
answer
2k
views
How to use spinner (LWC) with setTimeout
I have an LWC component that has a spinner in it as shown below
<template>
<form>
<div if:true={isLoading}>
<lightning-spinner alternative-text="...
0
votes
1
answer
135
views
Overlay Library - using referenceSelector to reference Element in Child Component
I have a parent aura component in which I have <lightning:overlayLibrary aura:id="overlayLib"/> included. I want the popover to be displayd next to a DOM element which exists inside a ...
1
vote
0
answers
449
views
Inject Angular JS in LWC
We have a proper Angular JS 1.4 application with App, Controller and service layers that works in VF page which we need to replicate exactly in LWC.
We have tried using LWC:dom="manual" to ...
1
vote
1
answer
581
views
Setting class name dynamically in LWC
I want to add class to a div dynamically,something like this :
<div class={getShowHideClassesInvoicesAndPayments} >
#!----content-#
</div>
Javascript:
...
0
votes
0
answers
109
views
This is my LWC and I want some flexibility in it
I want flexibility so that in the first row it ends with 105 and in the next row it starts with 201; it means it automatically creates a row start with initials 1,2,3 and it means if it ends with 105, ...
0
votes
1
answer
1k
views
How to test methods that change object fields (and some others methods) not decorated with @api using JEST in LWC
My LWC application includes a modal window and is written for use in Salesforce and uses Apex. I had a hard time writing tests for some functions, but I couldn't test the application until the end. I ...
2
votes
1
answer
134
views
Pass param to JS from html for rendering during iteration? [closed]
I want to check if the metadata.datatype === 'Checkbox' although i am not able to pass the param from html to js in LWC.
Code:
<template>
<template for:each={caseMetadata.data} for:item=&...