Questions tagged [lwc-dom]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
28 views

LWC Template tag not working for conditions

<template if: true= {isFlagValue}> showing some content on page when isFlagValue true but after getting false value for isFlagValue I am able to see content Heading
sneha's user avatar
  • 7
0 votes
1 answer
37 views

Change Data Capture and LWC on Mobile App?

I Have a LWC component setup to use CDC to refresh the apex of a varity of objects this intern affects the DOM (icons change / menu options change etc) this works fine on desktop however on the ...
ravent's user avatar
  • 11
0 votes
1 answer
75 views

Increase the performance/speed of Jquery dataTable in a LWC component

I'm using Jquery dataTable in a LWC component to load around 1500 records from Salesforce into the table. I'm using a SOQL query to fetch the records from SF and load them into the table. The data is ...
Rose Mirzaei's user avatar
-1 votes
1 answer
65 views

Salesforce LWC nested for each loops with if condition

I am trying to implement a listbox in LWC. The list box is showing values from a picklist in Account object. On click the value of the selected item is adding to an array. But on the UI it is not ...
Hasan Zubairi's user avatar
0 votes
0 answers
105 views

Access this.refs / lwc:refs="" when testing in jest?

I am attempting to use this.refs from with a jest test like this: <template> <input lwc:ref="inputEl" /> </template> // input.test.js import { createElement } from 'lwc' ...
lu_ke____'s user avatar
  • 403
0 votes
1 answer
54 views

LWC issue with array variable being blank when accessed from another function

I am building a custom file upload component as follows. I prepare my list of uploaded files inside the function handleFilesUpload. I then call another function called handleSaveFiles but inside of ...
degmo's user avatar
  • 61
0 votes
1 answer
61 views

@api variable name is 'template'

In my LWC we have a variable name 'template' . @api template Due to which below line is not working. ...this.template.querySelectorAll('lightning-input') Is there another way to grab all input ...
shamikh's user avatar
  • 13
0 votes
1 answer
82 views

Throw an error and block users when LWC is placed on wrong page type

I'm trying to do something, but I am stuck on this scenario. So, I have a lwc that can be placed on multiple pages (Record Pages, Home Pages etc). The users will define the component destination, in a ...
blanco17's user avatar
0 votes
1 answer
146 views

LWC lightning-modal initial focus on header

According to documentation lightning-modal documentation When the modal opens, focus goes to the first interactive element in the modal. If the header includes a link in tagline text, the link gets ...
sfrazlond's user avatar
2 votes
1 answer
135 views

LWC - Using lwc:dom="manual" to render text with innerHTML but it does not work

I'm using lwc:dom="manual" and querySelector to capture and display the text content but it does not work. HTML code <h2 class="slds-truncate" title={record.Name}> <a ...
Pam's user avatar
  • 97
1 vote
1 answer
33 views

Newly record not showing up when created using the 'createRecord' from 'uiRecordApi'

I am practicing Apex but I guess I'm stuck on trying to achieve something. I have a memory game in Apex. When a user finishes with the game, an record is inserted using the 'import { createRecord } ...
Pedro Henrique Ferreira's user avatar
0 votes
0 answers
98 views

How to render an array of objects (label,value pair) effectively on a lightning checkbox group functioning as a dropdown?

I need a checkbox group as a dropdown and have the following array formed in LWC JS handleShowingStateFilters(resultSet){ this.stateFilterOptions = []; this.tempArray = Object.keys(...
amitsingh6651's user avatar
0 votes
1 answer
48 views

I can't refresh the data from the button on LWC component

I created this component and the idea is to get all the files and put in one place. But I also need to add a refresh button, so it could return and new files that were uploaded. But I am not sure how ...
Fabio Niglio's user avatar
0 votes
1 answer
2k views

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'values') [duplicate]

I need to render some values in the screen based in boolean variable (isLaborOrPartsLabor), and i'm setting this one in a method inside the renderedCallback(), basically, when this one it's true i'm ...
Gustavo Fazilari's user avatar
1 vote
1 answer
105 views

LWC @api param is being passed by reference or not?

I have a parent component with this JavaScript code: import { LightningElement, track } from 'lwc'; export default class ParentComponent extends LightningElement { myValue = { value:'hello' ...
Juan de la Fuente's user avatar
0 votes
1 answer
158 views

After adding a slds float left for second line onwards its not aligned to left any suggestion for this?

<div key={rec.Id} class="slds-clearfix slds-float_left"> <h2 class="slds-text-heading_medium slds-hyphenate heading-title"> {rec.Name__c} </h2> </div> ...
Somesh's user avatar
  • 1
0 votes
1 answer
239 views

How to change the css of a standard SF component in LWR site

I have been using an LWR site with no theme selected (Basically a blank theme). I have used the web-to-lead markup in a custom LWC, but I need to change the styling of the form. Is there a way to do ...
Darryl Le Roux's user avatar
0 votes
0 answers
29 views

How to refresh the list of records in lightning-datatable after adding a new record to it in LWC [duplicate]

I have an LWC component which has a list of records displayed onload from a wire method. I have an Add button below the list to create new values from a modal save. Now, When I click the add button, I ...
sfdcDev's user avatar
  • 25
0 votes
0 answers
149 views

How to call renderedCallback() in HandleChange field input only once

I have LWC with search input, with every handleKeyChange click on input, renderedCallback() is called, but I need it to call only once. Controller: @track hasRendered = false; @wire(getAcc, { ...
annat's user avatar
  • 1
6 votes
1 answer
1k views

Alternate to if:false in LWC

Now salesforce is going to deprecate if:true & if:false and the alternate to these 2 tags is lwc:if, lwc:elseIf and lwc:else Now replacing if:true is simple, just change it to lwc:if but if I want ...
gs650x's user avatar
  • 2,600
-1 votes
1 answer
145 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 ...
Apex Srinivas's user avatar
0 votes
1 answer
310 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 ...
monk's user avatar
  • 3
0 votes
0 answers
126 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. ...
SFDC coder's user avatar
3 votes
1 answer
442 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 ...
Rob Baillie's user avatar
0 votes
0 answers
45 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'...
nstuyvesant's user avatar
5 votes
1 answer
201 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 ...
Bryan Anderson's user avatar
0 votes
0 answers
99 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 ...
Lalitha jakka's user avatar
0 votes
1 answer
691 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"> ...
gs650x's user avatar
  • 2,600
1 vote
0 answers
217 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 ...
Sacha Dieryck's user avatar
0 votes
2 answers
501 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 ...
Fahim Khan's user avatar
1 vote
1 answer
350 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 ...
Amax1's user avatar
  • 109
2 votes
1 answer
451 views

How to pass the array of values to mult-picklist from LWC to apex

{ "language": "English", "country": "GB", "successValidation": true, "businessEmail": "[email protected]", "...
vijay's user avatar
  • 39
2 votes
1 answer
746 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-...
Mujahid's user avatar
  • 121
0 votes
1 answer
506 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 ...
ANKIT SHARMA's user avatar
0 votes
0 answers
39 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 ...
Seiger's user avatar
  • 1
1 vote
0 answers
59 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 ...
Piotr Bokiej's user avatar
0 votes
1 answer
448 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 ...
Alex's user avatar
  • 3
0 votes
1 answer
91 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')....
SBN's user avatar
  • 21
1 vote
0 answers
288 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 ...
vector_infinity's user avatar
3 votes
0 answers
287 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:/...
BenBates's user avatar
  • 201
1 vote
1 answer
3k 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 ...
Sagar 's user avatar
  • 25
3 votes
1 answer
484 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="...
Narsi's user avatar
  • 37
0 votes
1 answer
1k 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=&...
raholed's user avatar
  • 25
0 votes
1 answer
762 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 ...
Paritosh Gharpure's user avatar
2 votes
0 answers
666 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:...
Anzar's user avatar
  • 954
0 votes
1 answer
3k 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(...
tamanna's user avatar
  • 11
0 votes
0 answers
391 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 ...
John's user avatar
  • 1
0 votes
1 answer
2k 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 ...
darthcoderUS's user avatar
0 votes
1 answer
886 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 '...
darthcoderUS's user avatar
1 vote
1 answer
908 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 ...
darthcoderUS's user avatar

1
2 3 4 5