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

tableau visualization issue with LWC

I'm New to LWC and I'm trying to include tableau visualization with LWC. I have a combobox where I store all my tableau urls. On combobox change i'm chaning the url value but the view is not re-...
7
votes
1answer
141 views

Retrieve standard and custom notifications of a user in Apex

Is there a way to fetch the unread bell icon notifications of a user in Apex? We have a community built on the Build Your Own (LWR) template where we need to implement an LWC component that displays ...
0
votes
0answers
21 views

lightning-tree with filter (search input) LWC

Is it possible to search inside a lightning-tree component and the tree shows only the searched item and it's hierarchy? This is how the tree is generated: fetchRolesCollapsed() { var action = ...
2
votes
2answers
61 views

Unable to print Error toast message

Hope you're doing well. I want to print an error toast, the pop-up appearing but the message is not printing. I researched and tried a lot about that but was unsuccessful. Below is my JS controller. ...
0
votes
1answer
32 views

Flow Complex Apex Defined

I'm trying to pass an apex defined variable from LWC to flow, the class looks like this: public class Subs { @AuraEnabled public String name{get;set;} @AuraEnabled public List<...
0
votes
0answers
20 views

DOM handling in Experience Builder: Components inserted via code vs. drag and drop

I'm trying to set up a component registration process as described here . This works fine for the component c-sub-navigation, which I inserted manually. The second component c-knowledge-display is ...
0
votes
1answer
37 views

Lwc spinner Container Position Issue

The spinner container moves up when I scroll down. How to fix the issue without using the spinner inside a modal? <template> <div class="slds-theme_default"> <div ...
0
votes
0answers
18 views

Up/Down List for Lightning-Input

I have an LWC with dynamically-rendered lightning-input fields in a MODAL card and record edit form (snippet here): ... <template for:each={...
0
votes
0answers
42 views

LWC detect page change event fired

I have a problem with my popup on Salesforce Community/Experience Page. I want it to close, when user change pages via navigation links, which are in other lwc components. I am currently using ...
1
vote
1answer
46 views

Unable to load Editor.js into LWC

I am trying to use Editor.js within an LWC Editor.JS source file. I've added the 3rd party library as a Static Resource And the LWC JS file is: import { LightningElement } from "lwc"; import ...
0
votes
2answers
25 views

Change object view but keep record type [closed]

I have been requested to do two different page views for an object for the same user. Both must be able to be configured using layouts. I am not allowed to change the record type because it has ...
0
votes
0answers
22 views

Case and Account Association with Embedded Chat Transcript through Lightning Web Component

I have created a Lightning Web Component for embedded pre-chat form which on click of chatbot button creates a case and associate an account with the created case. I want to associate that case with ...
1
vote
3answers
121 views

How to color the utility icons in lightning datatable in LWC?

I have the below data table where I have two icons. I want to change the color to blue instead of grey. The variant property is not helpful. How do I do that? HTML: <div class="myTable"&...
0
votes
1answer
31 views

How can I connect vs code to my subdomain

I am new in learning lwr & lwc. I have installed VS Code, salesforce extension pack inside VS code, & Salesforce CLI . On salesforce side I created a new site/subdomain in my sandbox by >...
0
votes
1answer
61 views

Sorting custom list items in LWC via Drag and Drop

Using the great work of Don Robins' presentation on LWC Drag and Drop at https://forcementor.github.io/lwc_dnd_20/#/ I've implemented the majority of a solution that allows a drag and drop enabled ...
2
votes
1answer
23 views

Query in Apex Class is duplicated every time wire decorator in LWC is triggered

I'm still fairly new to LWC & Apex, so here goes: I have a datatable and a lightning input field which is passing a searchKey variable to the wire decorator: @wire(getAllChildRecordsByRecType, { ...
1
vote
1answer
62 views

How to copy data from Excel to LWC lightning datatable? [closed]

With the given requirement to allow users to paste content into multiple cells of a LWC lightning-datatable, where the user has previously copied those values from an Excel sheet, what would be the ...
0
votes
1answer
40 views

How to catch the event of clicking the "Clear" button in lightning-input type="search"?

How to catch the event of clicking the "Clear" button in lightning-input type="search"? In the salesforce documentation, this is not specified, I found a similar question, but for ...
0
votes
1answer
69 views

lightning web component specialist

Not able to complete the challenge. Can anyone help me Build the component boatSearch Challenge Not yet complete... here's what's wrong: We can't find the right settings for the lightning-button in ...
0
votes
1answer
52 views

making an LWC dynamic?

I have an LWC that i placed on the contact page and would like for it to display the contacts information, but have it change to whatever contact the user is currently viewing. so far,the card is ...
0
votes
1answer
28 views

How to remove this huge distance between label and input in LWC?

How to remove this huge distance between label and input in LWC. I didn't use custom styles, only from the salesforce lightning design system. Here's my code from the HTML file: <div> &...
0
votes
2answers
45 views

Wait for Promise to finish executing in Javascript Function

I am calling a javascript function getSObjectfromRecordId and passing in an ID such as "0035f00000DrrSdAAJ". When the function getSObjectfromRecordId calls the apex method getSObjectFromID, ...
1
vote
1answer
48 views

Can we use Swipe / Touch events in LWC mobile

A very happy new year to all of u . I am trying to built a swipe/ touch feature using lwc for mobile version like below I have reached till this point where i am able to swipe it, but after ...
0
votes
1answer
50 views

Receiving error "Component has an invalid value for property." on App Builder

I have build a custom IconProvider class to display list of SLDS icons for selection on Lightning App Builder. public with sharing class IconProvider extends VisualEditor.DynamicPickList { public ...
0
votes
2answers
51 views

LWC record display issue

I have two objects in my org question and answer which has a lookup relationship between them. I wanted to create a LWC component which displays one question with multiple answers but I am unable to ...
0
votes
1answer
33 views

How to pull event from function

Can u help me and tell how can I use event.detail.row.ticker in @api tic = ; (I am realy bad in JS and =I don't know how can I pull it out.) JS companySymbol =''; @api tic = ; @wire(...
0
votes
0answers
29 views

Unable to apply css to the accordion section in LWC [duplicate]

I have created lightning-record-view form using LWC. I am using accordion in that and want to change the background color of accordion heading and want to increase the font size of lightning-out-field....
0
votes
1answer
24 views

:Missing matching tag for <lightning-record-view-form> this lWC getting error i don't know what's wrong

<lightning-accordion-section name="ProductDetails" label="Product details "> <div class="slds-grid"> <div class="slds-col ...
2
votes
2answers
84 views

Component is not refresh during 2nd attempt after clicking on new button

I have overridden Standard New button on lead object with Aura Component and this Aura calls LWC which contains record edit form to create new lead record. I have 2 record types Record Type 1 & ...
0
votes
1answer
35 views

How to get orgId programmatically for web-to-case form?

I'm running a community site and wonder, if there is a way to get orgId for the web-to-case form programmatically via the LWC JS controller. If not I have to work on that value each time I deploy the ...
0
votes
2answers
49 views

Is it possible to know in which FLOW a specific LWC is used?

Due to project and requirements, I need to update a Flow that uses a specific LWC. I know the LWC that I need to change but I don't know the flow in which this LWC is used. Project has a lot of Flows ...
2
votes
1answer
61 views

Tag and @mentions in custom LWC?

I'm attempting to tag a users in a custom lwc component. THis is my current code. @AuraEnabled public static void postFeedItem(String msgTxt, String recordId){ ConnectApi.FeedElement ...
0
votes
1answer
49 views

Can I preview LWC component locally in VS Code while building the html?

I would like to see a preview of LWC component HTML while building the component. Is there a way to see html preview of this? Normal html preview extensions work only for html not LWC specific tags ...
-1
votes
1answer
45 views

Search inside lightning-dual-listbox in LWC [closed]

I have a component with a lightning-dual-listbox. I need to make a search function for the available items. The user searchs and only the matching items are going to be displayed. This is the code: &...
1
vote
1answer
67 views

LWC - NavigationMixin.GenerateUrl promise returns JavaScript:void(0)

In my component, I have an api setter method for recordId and I am generating a URL based on the given recordId inside the setter. I am storing the generated URL and using it as href value like this &...
1
vote
2answers
96 views

How to display 2 columns in LWC accordion section?

I have created a record edit form and I am passing fields dynamically from field sets. Below is the HTML code where it display only 1 field at a time. I want to display 2 columns instead of one. LWC ...
1
vote
1answer
27 views

lightning-tree with drag and drop feature [closed]

I have a LWC component with a lightning-tree for role hierarchy. I need to implement a drag and drop function for the items to reorder them and save the new hierarchy. This is the tree: <lightning-...
-2
votes
2answers
43 views

How to hide or remove the child component that rendered by parent component in a template loop of html in LWC

<template> <template for:each={cmpList} for:item="ele"> <div key={ele.id} class={ele.id}> {ele.id} <c-stopwatch childid={ele.id}>&...
0
votes
1answer
37 views

Breadcrumb for lightning-tree

I have a lightining-tree component for Role Hierarchy. This is the item: <!-- ROLE TREEVIEW --> <lightning-tree items={items} onselect={handleSelectAssign}></lightning-tree> <!-- ...
0
votes
0answers
36 views

How to render data from child record in LWC Datatable?

import { LightningElement, wire, api } from 'lwc'; import fetchProducts from '@salesforce/apex/ContactsController.fetchProducts'; import updateProducts from '@salesforce/apex/ContactsController....
0
votes
1answer
29 views

How to create a link to a third-party Internet resource in LWC?

How to create a link to a third-party Internet resource in LWC. Not to another LWC, not to any object associated with LWC or Salesforce, but for example to https://developer.salesforce.com/docs/atlas....
0
votes
1answer
35 views

Creating a case with createRecord LWC error/trouble

I'm just trying to create a simple LWC that creates a case record from a button click. When I add the component to the account page and click the create button nothing is happening, there are no ...
0
votes
1answer
41 views

How to use '==' in Template string in LWC? [closed]

I want to set check array value dynamically while looping in template. My array: Products =[ {ProductName: 'JSON1', Status: 'Active'}, {ProductName: 'JSON2', Status: '...
0
votes
1answer
27 views

Unable to print Class Name using querySelector()

I am having trouble printing class name using querySelector() instead it is printing whole element. I know I'm missing some small attribute but can't figure out as I'm coding after long time so unable ...
0
votes
0answers
47 views

How to hide field in Lightning-record-form?

I'm using two lightning-record-form to display Case fields , but since the field Type isn't displayed in the 2nd recordForm , the field WaitingforStakeholder is grayed out because i'm using Type and ...
2
votes
1answer
49 views

Unable to print entered values in console

I'm trying to print the entered values after clicking save button in console.log() after clicking it's printing SecureElement: [object HTMLInputElement]{ key: {"namespace":"c"} } ...
1
vote
0answers
70 views

Why getRecordNotifyChange doesn't refresh the Lightning Page when record is changed?

Assuming we have custom object Test__c with custom picklist field and two record types. Custom LWC component with the following html <template> Status: {status} </template> and js ...
0
votes
1answer
18 views

get set method of lwc isn't producing desired result

/* HTML File */ <template> Value = {uppercaseItemName} </template> /* JS File */ import { LightningElement } from 'lwc'; export default class GetSetLWC extends LightningElement { ...
0
votes
0answers
24 views

Navigate to search community page in lwc

I have a problem with NavigationMixin.Navigate, it redirects to Invalid Page. I think that it is because of the :term in search url. My code: this[NavigationMixin.Navigate]({ type: '...
0
votes
1answer
34 views

Correct representation of DOM in LWC?

Sharing my visual understanding of DOM. Please let me know if this is correct? Also please do share more useful material or your viewpoints. Will be helpful.