Questions tagged [lwc-dom]

The tag has no usage guidance.

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

How to validate fields programmatically in a lightning-record-form

I have a simple lightning-record-form. At the time of submit, I need to validate if the values are valid because I am implementing a "save and add next" button that saves the current entry, ...
0
votes
1answer
22 views

How to create a table with no borders using standard lightning-datatable?

I'm trying to create a table "With No Borders" using standard lightning-datatable of LWC. I'm referring to the pieces of codes given in https://www.lightningdesignsystem.com/components/data-...
1
vote
0answers
27 views

LWC - Apply a class to a div based on the state a specific user left it in

I have a LWC with a button ("Toggle Sales Coaching) that when selected toggles the slds-is-expanded class off and toggles the slds-is-collapsed class on. I would like for the component to know, ...
0
votes
0answers
24 views

LWC | Using for:each does not return {parameters} in loop

When I click in custom button I am rendering some lightning-inputs to html file depends how many records I have chosen before. If I have chosen 1 record of Service, i am rendering 2 inputs for single ...
0
votes
0answers
17 views

Switching Community Tab(Default) From button click IN LWC

Suppose we have 2 tabs in which we have 2 buttons in each tab. When we click on button1 which is in tab1. then it will open tab2. Can we do this with the default community tabs IN LWC?
5
votes
0answers
56 views

Will salesforce continue to support bringing in third party js inside lwc or not?

We have some lwc components in our app, that took advantage of bringing in third party code (in our case, jQuery, angularJs etc. We did that to bring in some legacy code inside lwc. The code was ...
0
votes
1answer
34 views

How to access LWC DOM?

Due to Shadow DOM and Locker Service, I am unable to access LWC DOM. Is there any workaround for a 3rd Party JavaScript to access LWC DOM?
0
votes
0answers
23 views

DOM manipulation using external library Add to Calendar in Lightning web components?

I am trying to do a simple add to calendar some thing like discussed in [here].(https://github.com/AddToCalendar/addtocalendar/blob/master/sample.html in LWC. I am not able to achieve the same ...
1
vote
1answer
63 views

LWC Datepicker in modal not displaying correctly

I have a requirement wherein I used <lightning-input type="date" variant="label-hidden"></lightning-input> for adding a datepicker in a modal pop up. But, the date-...
1
vote
1answer
156 views

Spring'21 Use CMS Content in LWC

I wanted to add an image ( CMS Managed ) to a lightning web component. here does my code look like TestCMS.html <template> <img data-contentkey={contentId}> </template> TestCMS....
1
vote
1answer
45 views

What is the use of event.preventDefault(); with respect to events in lightning web components. does it refer to prevent bubble phase execution

I understand that it stops the default phase of execution of the events, but what does it exactly mean. //child component.js import { LightningElement, track, api} from 'lwc'; export default class ...
3
votes
1answer
217 views

LWCs cause 10-20 seconds of lag populating a small amount of elements on the page

I have an LWC template like this: <input list="counties"> <datalist id="counties"> <template for:each={counties} for:item="county"> <option key=...
1
vote
0answers
23 views

How to pass api values starting with “on” in LWCs to create form abstractions?

In modern JS development ecosystems, we have form abstraction libraries to aid in creating of forms with rich interactivity. In my app, I attempted to do something like this: export default class ...
0
votes
0answers
62 views

iFrame contentWindow LWC

I have a LWC with an iframe inside. The iframe's src is a URL from an external system that loads a Document Editor. I want to access the contentWindow of the iFrame. var editor= this.template....
0
votes
1answer
30 views

LWC render nested component within lightning-record-edit-form

I am working on building a LWC that componentizes lightning-record-edit-form, but the form cannot evaluate the lightning-input-field when the fields are nested within another component. The basic ...
0
votes
0answers
19 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
42 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
47 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
56 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
65 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
123 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
47 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
55 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
62 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
15 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
76 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
87 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 ...
3
votes
1answer
339 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
102 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
126 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
248 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
98 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&...
1
vote
1answer
377 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
250 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
41 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
93 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
147 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
225 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
53 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
128 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
175 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
221 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
406 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
154 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
248 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
1k 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
297 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
997 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
487 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
583 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-...