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
1answer
15 views

Highlight all text when clicking into lightning-input LWC

I would like to highlight the existing text in a lightning-input when I jump into it by clicking or tabbing. Is there an easy way to accomplish this? Here is what my input looks like: <lightning-...
0
votes
1answer
12 views

LWC datatable Header wrapping

I am working on a LWC component where in a lightning datatable I have more than 7-8 columns. When I add the component into detail section of a record page, the headers of the table is getting ...
4
votes
1answer
29 views

Can an @AuraEnabled method be added in a managed package patch release?

I have a managed package with an LWC component. I need to enhance this LWC in a patch to allow it to receive some additional data during its initialization, which is done using an @wire. The data ...
0
votes
1answer
26 views

Salesforce LWC : how to call a method of the loaded script in the javascript?

how to call a method of the loaded script function in the javascript? Ex: if I have loaded a script named ‘abc’. Now I want to call a method of the abc. Let the method be fgh. How do I call it in LWC?
0
votes
0answers
12 views

FullCalendar in Salesforce -> Get the event when user changes view

I have implemented fullCalendar.io to my Salesforce dev org in order to have a custom calendar lightning component. So I found an LWC that uses those libraries and made some minor changes. The reason ...
0
votes
0answers
7 views

How to insert bulk opportunity products with list of reference products in salesforce lightning [closed]

We have a custom object called opportunity product(which is not a standard opportunityLineItem, but created this object to full fill similar characteristics as standard object ). In the current system ...
0
votes
0answers
13 views

LWC Custom Label translation only working in Compact View

We're facing a strange problem in Scratch Orgs where the Custom Labels used in a Lightning Web Component are not getting translated unless we switch the UI to the Compact view. The translation for ...
0
votes
0answers
10 views

Create New Event Custom Button on FullCalendar.io

I have implemented an lwc using fullCalendar.io. I would like to use a custom button that when clicked it will popup the new event page. But it does not seem to work. The problem is between lines 75 ...
1
vote
0answers
15 views

Importing SVG from static resources

I have tried to import a custom SVG into my aura component using an LWC helper component as described in the docs. But the final output of the component is something like <use xlink:href="#...
0
votes
3answers
39 views

How to get button name or Id in LWC via handleSuccess event?

HTML <template> <lightning-record-edit-form object-api-name="CustomObjec__c" record-type-id="0120C000000Ay7WQAS" onsuccess={handleSuccess}> <lightning-input-...
0
votes
1answer
19 views

Display a specific cell value as a url in the lightning datatable in LWC

I need to have a cell value which has a string value such as "www.google.com" as a URL or a hyperlink. I don't want all the rows for a column to have url , so type = 'url' while defining columns won't ...
0
votes
2answers
40 views

Hide save button in lightning table in LWC

html: <lightning-datatable data={addressData} columns={columns} onsave={handleSave} key-field="id"></lightning-datatable> Js: handleSave(event){ let ...
0
votes
1answer
39 views

onClick event with to launch url LWC

I am working on making a lightning-datatable where one of the columns is a link from a button-icon. I am having trouble appending the corresponding link to each row in to a lightning-button export ...
0
votes
1answer
36 views

Append icon to column data

I am working on making a lightning-datatable where one of the columns is a link from a button-icon. I am having trouble appending the corresponding link to each row to a lightning-button-icon. ...
-2
votes
1answer
37 views

LWC1503: Parsing error: Leading decorators must be attached to a class declaration

my code is below as I declared (track) in the class still I am getting the error. import { LightningElement,track } from 'lwc'; export default class HelloWorld extends LightningElement {} @track ...
0
votes
0answers
12 views

LWC - Inline DataTable Save using wrapper class

I am trying to use Wrapper class in LWC Data Table.I am unable to save the data table the inline edit table. Can anyone provide any sample code using wrapper class in LWC Data table. Thanks.
0
votes
0answers
12 views

Modules of Modules - Lightning Web Components Referencing

Is there any way to reference modules of modules in LWC or must all components live in the parent folder as stated in the docs: "A component folder (bundle) must live in a parent folder that defines ...
0
votes
1answer
23 views

event bubbling in lightning web components

I was trying to implement event bubbling based on what the documentation says. For the scenario, where we mark bubbles as true and dispatch events to the element for the template where the event ...
0
votes
2answers
28 views

How do I create a new record and a new related record at the same time? (lwc)

So, I have a situation where I'm using a junction object (JD_AOR__c) for many-to-many relationship between two other objects, Job_Decription__c and AOR__c. I'm making a lwc that sits on the ...
0
votes
1answer
24 views

Lightning-Record-Form does not save a record?

I cannot for the life of me understand the issue i am facing. Basically i am trying to search for a case record and update it using lightining-record-form in edit mode in LWC. All works fine and the ...
0
votes
1answer
38 views

console logging array values inside renderedCallBack() would say undefined, If accessed directly throws afterRender threw an error exception

I have pushed some values into an array inside the @wire method and then when I try to console log those values through the renderedCallBack() function I get undefined, also if I try to access those ...
1
vote
2answers
24 views

LWC - Updating date field

Trying to update the following fields,Date field is not updating in updateRecord.( Other Fields got updated with correct value). When i console.log the new Date() it print as below. Sat Apr 04 2020 ...
1
vote
1answer
26 views

How to play audio in LWC

I have below code in JS to play audio playThis = Audio + '/Audios/Orchestral/Organic_cloudcity.mp3' playAudio() { let audio = new Audio(); audio.src = this.playThis; ...
0
votes
0answers
19 views

Unable to redirect from Community to Salesforce Org

Error when trying to jump between Community to Salesforce org. I am using a custom layout template and am not using the navigation menu. I tried this but this redirected me to the portal { type:...
1
vote
1answer
27 views

Wrapper class variable show as undefined in LWC

I have been stuck on this for a few hours, hope someone will be able to help me with this. I simplified the code as well. This is the error I am getting => [Cannot read property 'firstNameFieldLabel' ...
0
votes
1answer
24 views

FullCalendar.io and Infinite for Loop trying to show elements

I am new to LWC so i maybe do a common mistake. I have a LWC with implementing fullCalendarJS.io and I have customized the default solution to get via apex controller the events related to my org and ...
0
votes
1answer
33 views

Refresh the page after the lightning component

I have a lightning component that shows as button on the record page like below The lightning component Controller are like below <aura:component implements="flexipage:availableForRecordHome,...
2
votes
1answer
37 views

Unable to update tracked array in LWC

For some reason, the push in the code block below is not updating the array. The console.log statement displays the array with 0 elements. I created a local array variable and pushed to it with no ...
0
votes
2answers
28 views

LWC @wire and managing response in Javascript

I am new to LWC so i maybe doing something silly mistake here. I have implemented a custom calendar solution via a LWC. Now i want to get the events for the current user so what i have done is created ...
0
votes
2answers
37 views

I am not able to display the DataTable using Jquery in LWC

Below is my JavaScript Code:: import { LightningElement, track, api, wire } from 'lwc'; import { loadScript, loadStyle } from 'lightning/platformResourceLoader' import getAllOpps from '@salesforce/...
0
votes
1answer
31 views

How to show spinner while getting records from server with @wire

I'm getting data from server using @wire when the @api property changed. How to show spinner whenever getting data from server? @api classId; @tract isLoading = true; @wire(wiredMethod, { classId: '...
0
votes
0answers
19 views

REST API HTTP CallOut error in same domain [duplicate]

I am using this code to call a REST API inside my same domain HttpResponse res = new HttpResponse(); Http http = new Http(); req.setEndpoint('https://chaarvim-dev-ed.my....
0
votes
1answer
18 views

Disable one of the checkbox in lightning-checkbox-group in LWC

Currently, I am displaying a set of checkboxes on the screen using lightning-checkbox-group, but I need to disable one of the checkbox conditionally. So, looks like we have a 'disabled' attribute in ...
0
votes
1answer
20 views

LWC update toggle checked/unchecked attribute from JS

First of all I’m new to LWC development so I would like to apologize if the question looks stupid. I’m currently working on a LWC and I would like to create 2 toggles but I want only one toggle to be ...
1
vote
0answers
13 views

How can we add manifest to Lightning Web Component/Aura Component?

I am trying to build a progressive web app for the Community, I am not sure how I can add the manifest and Service worker dependencies in the LWC/Aura Components. I have found this article which is ...
2
votes
1answer
39 views

What is the need for bubbles and composed in lwc

I'm studying LWC Events and came across bubbles and composed. I'm not able to understand the need for both.. Let's consider two components 'Component A' && 'Component B', A is the parent here....
1
vote
2answers
51 views

Error with Events lwc - [NoErrorObjectAvailable] Script error

I'm trying to implement a small use case of CustomEvent() in lwc and it's not working. I have implemented custom events in past and I'm not sure what I missed here. Child Comp: HTML: <...
0
votes
1answer
29 views

call default “New Account” Action in lwc

In aura lightning component we can call the default create new account action by using var createAcountEvent = $A.get("e.force:createRecord"); createAcountEvent .setParams({ "entityApiName": "...
1
vote
1answer
25 views

Fetch HTTPcallout API issues

I am trying to do some POC on sObject tree. Below code run's fine . But i am just getting empty response {} in console.log. Not sure what i am doing wrong. Can you please help import { ...
0
votes
1answer
21 views

LWC - Invoke Data Table from the Row Actions of another Data Table

I have requirement to display a data table based on the row actions of another data table through pop-up. I have done the pop-up through row actions But I am unable to pass the id of the row to the @...
-1
votes
0answers
25 views

I have created a signin component using lwc. I want to verify the fields email and password [closed]

HTML <template> <div class="slds-m-top_medium slds-m-bottom_x-large"> <h2 class="slds-text-heading_medium slds-m-bottom_medium"> <center>...
0
votes
1answer
77 views

Change div location based on page location

I have the following lwc component: There are two sections in this component: "license details" and "notes". I want to be able to move the side panel(marked in red) as i scroll through the page. "...
0
votes
0answers
23 views

error in loadStyle LWC

I use the custom calendar LWC from https://github.com/Gurenax/sfdx-lwc-fullcalendarjs In the js controller, i get an error on loadStyle(this, FullCalendarJS + "/fullcalendar.min.css") line 30 full ...
0
votes
1answer
9 views

Invalid reference FullCalendarJS of type resourceUrl in file fullCalendarJs.js

I am trying to deploy to my dev org a custom calendar lightning component https://github.com/Gurenax/sfdx-lwc-fullcalendarjs. I have copied the code but the problem is when i try to deploy it i get ...
7
votes
4answers
344 views

Is it possible to make one css or js in common to all my Lightning web components?

Here is my situation, I have two (and soon more) LWC, inside each component, I have the classic : html, css, js and xml. In my case, the first LWC is having many css properties in common with the ...
0
votes
1answer
21 views

What colors are supported by slds-progress-bar?

By default, the progress bar is blue. I am interested in other colors, particularly in red. The documentation only shows an example for "success" (by using the class slds-progress-bar__value_success),...
1
vote
1answer
22 views

How to read parent object value in LWC wire metho

How to read the Parent object field value in LWC, In the Below Soql fetching account.name, While reading in JS It's prints undefined Apex: @AuraEnabled (cacheable = true) public static List<...
-1
votes
1answer
41 views

LWC (Lightning Web Component) - Properly accessing Data and placing into Lightning Data Table

I have a custom APEX Class that returns two sets of data (Activities & Notes), I would like to individually access each of those arrays of data and place them into separate Lightning Data Tables. ...
1
vote
1answer
29 views

page has an error - lwc

I'm trying to create a type-ahead in LWC wherein I'm using imperative approach(this is what I want to use - not @wire) to make get matching record names from back-end. However, when I type anything in ...
0
votes
0answers
12 views

Navigate to Report with dynamic filters from LWC

I have requirement in which need to navigate to report page with dynamic filters(fv0) in the URL from LWC. Please let me know how to add report filters in the attribute{} ? Similar post: Navigate to ...

1
2 3 4 5
46