Questions tagged [lwc-dom]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
7 views

Custom modal window in Salesforce 1 is always displaying at top of the page in LWC

I have implemented a custom modal window which opens up when I click on a td. It's working fine in desktop but when checking in mobile , the modal pop up is always coming at the top. If user is at the ...
0
votes
1answer
32 views

Fetch value using the key in lwc

I have a question regarding iteration in the js file of an lwc component I have a array of the following JSON format [{"key":"0036F00003hXBGAQA4","value":"...
0
votes
1answer
41 views

Event not getting fired from a lwc custom lookup component

I have used a custom lightning datatable which has a component displayed as a lookup customLightningDatatable.html import LightningDatatable from 'lightning/datatable'; import lookupTemplate from './...
1
vote
1answer
24 views

Cannot read property fields of undefined

I need to understand where I am going wrong in the below piece of code. The error screenshot is shown below. HTML Template:- <template> {name} </template> JS Controller:- import { ...
0
votes
0answers
58 views

Toast is not showing in LWC in community

import { LightningElement, track,wire } from 'lwc'; import { ShowToastEvent } from 'lightning/platformShowToastEvent' import Lead_Object from '@salesforce/schema/Lead'; import {...
0
votes
1answer
41 views

How to get the selected value of a picklist field in lightning combo box using template.getQuerySelector?

How to get the selected value of a picklist field in lightning combo box using template.getQuerySelector?. <lightning-combobox label={firstControllingFieldLabel} name=&...
1
vote
1answer
33 views

Get picklist values on record type(not a default) without hard-coding of record type id and object have more than one record type in Salesforce

I have a scenario where i have LWC component A and in its html it uses LWC component b (In this LWC component i have built the picklist dependency + record type). So that in component A in HTML i ...
1
vote
1answer
34 views

Unable to use lwc:dynamic directive in LWC component

How do I enable the lwc:dynamic directive or is it tied to certain release of Salesforce?
0
votes
1answer
38 views

lightning-input-rich-text component throws errors when clicking inside of the rich text area

I'm trying to follow the examples provided at https://developer.salesforce.com/docs/component-library/bundle/lightning-input-rich-text/documentation. The very first example is: html: <template> ...
0
votes
0answers
14 views

options can not be updated to combobox when changing values in promise then()

I don't know why the @track options can't bind to the combobox. but if I move the // in the then(){}, it can bind to the combobox normally. app.html <template> <lightning-combobox ...
1
vote
1answer
58 views

Lightning Web Components, Lightning-datatable / Lightning-tree-grid DOM traversal [duplicate]

With the API I managed to get this.template.querySelector("lightning-tree-grid"), but getting to any inner element returns empty proxy object. With the browser console I manage to find the ...
0
votes
1answer
43 views

Integration of tinyMce with LWC is not working

I am trying to use tinyMce Rich text editor in an application based on LWC instead of lightning-input-rich-text. I uploaded tinymce.min.js file in static resources and is using that in my component ...
2
votes
1answer
124 views

event.dataTransfer is getting undefined in JEST for dragstart

I'm trying to implement Jest tests for a module(to reorder data table rows). However, I'm unable to mimic the dragstart event. Can anyone help me to achieve the same behavior - Here is the function ...
0
votes
1answer
44 views

Page gets reloaded on CSV download in LWC

On click of a button, CSV file should get downloaded. I have used below Javascript code for same. JS: functionName(){ var anchorTag = document.createElement('a'); anchorTag.href="data:text/csv;...
1
vote
1answer
58 views

Importing third party JS in LWC is not working

I am trying to integrate tinyMCE editor with LWC. I have followed the below steps to do so; Download the tinyMCE resources and uploaded it as static resources in my org I am using the loadScript ...
0
votes
1answer
70 views

How to display/preview directly an image file attached in a custom object with the help of lwc, without using preview button

.js file import { LightningElement, wire, track } from 'lwc'; // importing Apex class method import retriveFiles from '@salesforce/apex/LWCExampleController.retriveFiles'; // importing navigation ...
0
votes
1answer
41 views

Salesforce - Lightning Aura Slots

Hi I wanted to use slots. I know it is supported in LWC and it works fine. I have scenario where I have AURA component (Parent) having LWC (Child). <aura:component controller="OpportunityData&...
0
votes
1answer
94 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
99 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 ...
0
votes
0answers
36 views

How to get CDATA text whether in APEX or Javascript from the below RSS feed example I only end up with null values

<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:abacus="http://www.abacusemedia.com/webvisioncloud/" xmlns:media="http://www.abacusemedia.com/...
0
votes
1answer
54 views

messageChannel folder in vscode

Does the messageChannel folder should automatically create when i create new sfdx manifest project in vscode? Or i should create it manually?
1
vote
2answers
81 views

LWC: Pass a record field as a parameter to apex

I wish to query for parent record data (which is a lookup). How do I pass a parameter to the apex class that is not the '$recordId'? Apex class: public with sharing class cc_CaseOrderController { @...
0
votes
1answer
120 views

How to hide an element based instead of removing from DOM

I want to be able to show/hide a child LWC in a parent based on a variable (let's say showOrHideMe). But this showOrHideMe boolean is coming from child component itself. Trying the below approach ...
0
votes
1answer
44 views

Query Selector is not working when I am putting inside renderedCallback Lifecycle hook in Lightning Web Component

I am creating a variable crashride and doing querySelector inside renderedcallback then I am using that variable inside another function. But if I directly say this.crashride inside the function ...
0
votes
1answer
87 views

LWC Vertical Navigation

I want to build a vertical navigation menu which can direct the users to specific paragraph or div with Id/Class inside a scrollable region. I tried the following codes but none of them works. Please ...
0
votes
0answers
108 views

LWC recordType name and description Selection component

I'm passing Map of record type - name and description from Apex to LWC and need to show the Name and description on UI with radio button to select name value. JS Part export default class xyz extends ...
3
votes
2answers
109 views

CSS class not getting added to the LWC

I Have created an LWC component with following files .HTML file ... <lightning-datatable key-field="id" data={data} columns={columnsInProgress} is-loading={tableLoadingState} ...
1
vote
1answer
186 views

LWC Component Tabs are not getting refresh, when moving back and forth on different tabs in the Lightning App [duplicate]

I created an LWC component with lightning-radio-group and added it to the Lightning App, it only shows which value is selected by the user. As I selected value and move the back and forth on the tabs ...
1
vote
1answer
101 views

Using value from parent LWC in a child LWC to draw a chart

Howdie! I am trying to pass a value from a parent LWC to a child LWC and use that value in child LWC to draw a donut chart using Charts JS. Problem I am facing is that when I print the value passed ...
1
vote
1answer
161 views

Calling apex class method in LWC using @wire annotation

Awesome people , I am bit new to LWC coding . Please do let me know ,What i am doing wrong here. I need to display the count of Child Contacts in Html template in lwc. I am not able to display size in ...
0
votes
2answers
412 views

How to select a element using querySelector that has dynamic name?

I have a lightning-button-icon with dynamic name and i want to update its selected attribute based on the name. Can someone tell me how can i do that? my code (UPDATED): <lightning-layout-item size=...
0
votes
1answer
204 views

Refresh button with time in lwc?

I have kept the refresh button my requirement is when I click the refresh button it needs to show the time for each time refreshing the page or record there is any resolved solution? Like this, I need ...
3
votes
1answer
501 views

What is Lightning Element in Lightning Web Component

I have gone through definition of LightningElement but unable to understand it clearly. Definition LightningElement is a custom wrapper of the standard HTML element.It extends element to create a ...
0
votes
3answers
307 views

disable the cursor pointer on lightning-output-field in lwc

i am trying to disable cursor on lightning-output-field phone field but no luck. my styles are not rendering in UI. is it because am i applying styles for child elements? lwc.html <template> &...
0
votes
2answers
284 views

LWC: How to display svg icons

I'm trying to render a button with an icon just next to the text, unfortunately, the icon doesn't show even if it uses the space next to the text. <template> <button class="slds-...
0
votes
1answer
38 views

Lightning Web Component Issue in fetching the particular value in child component{Coming as undefined}

Hi i need to fetch the value of "defopen" from the JSON array i am passing , but getting as Undefined, kindly anyone please help. <c-childcomp dtest={stest}></childcomp> ABC(...
2
votes
2answers
261 views

How to get label of the node in lightning-tree in LWC

What is the way to get the label of the lightning-tree node on-click/on-select on javascript handler in lwc? myLwc.html : <lightning-tree items={sidebarStructure} onselect={handleSidebar}><...
0
votes
1answer
153 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 ...
0
votes
0answers
247 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
667 views

LWC create input fields under LWC iteration

I am new to LWC. I have to create multiple input fields for different rows. Let say, I have selected 3 records from the previous page and for all those 3 records I need to create the input field and ...
1
vote
1answer
440 views

How is the <template> tag used in lwc different from one used in web components?

According to usage of <template> in web components: The elements under template won't appear in your page until you grab a reference to it with JavaScript and then append it to the DOM For ...
0
votes
1answer
173 views

how to get the omniscript Vlocity data where my LWC is located?

I am new to LWC with Vlocity, I want to create an LWC that consumes the data found in the omniscript where the LWC will be hosted, how can I do this?
0
votes
2answers
426 views

In lwc lightning-combobox not able to select a value when binded dynamically, If i bind it with hardcoded values then i am able to select it

I am using below code to populate a combobox with dynamic value. But i am not able to select any value and it just gets back to blank value with placeholder text. HTML Code <template> <...
0
votes
0answers
26 views

Handle two check-boxes using same onchange event in javascript lwc. Getting same checkbox id for both the check-boxes

Getting same name and id for both the checkbox onchange event. Kindly, refer me to the best practices to access an element in javascript for lwc. Demo.html <lightning-layout-item size="6" ...
0
votes
1answer
38 views

Selection done in one iteration in aura, is reflecting in every other iteration

I have a scenario where I am calling a custom lookup lwc component inside my aura iteration. The issue is the value I am selecting in the custom lookup in one iteration is being reflected in all the ...
2
votes
1answer
410 views

Unable to Close Drop down menu on Outside click in LWC

I am unable to close the dropdown menu in LWC on clicking anywhere else on the page apart from the dropdown menu . Please find the code below , HTML Code : <a class="userStyle" role="button" ...
0
votes
1answer
2k views

how to convert CSV file to array of JS objects in LWC

I have a custom LWC page where I am importing an array of JS object to CSV and it is working as expected now I need to do some changes to that csv file and upload it on the page and convert it back to ...
3
votes
0answers
227 views

Lighting Data Table with large data set lagging on chrome browser

So I have this requirement to show folder and report as a hierarchy in LWC (used lightning tree for the same with custom icons for folders and reports.) and on click of any report, we fetch the report ...
0
votes
0answers
29 views

Unable to apply if condition in iteration in LWC [duplicate]

<template> <lightning-card variant="narrow" icon-name="standard:opportunity"> <h1 slot="title">{Name}</h1> <h1 style="margin-left:4%;">{Header}</h1> ...
0
votes
1answer
533 views

Freeze first column in the lightning data table lwc

How to freeze the first column vertically of the Lightning Data Table LWC ? Since LWC is enforcing the shadow DOM style scoping. I have encapsulated the LWC component inside an Aura component and put ...