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
2answers
28 views

Reference wire getter value as Javascript variable in LWC

This seems like it should be really simple but I am finding it impossible to get wire field values into a variable I can then use within the Javascript code (such as concatenating them into a String ...
0
votes
1answer
23 views

How to insert field value and ID to dual list box from APEX controller

I am making a Lightning Web Component and for it I want to populate a dual list box with a list of records, with the value of one field being the label and the ID of the record as the value. I am ...
0
votes
1answer
21 views

Render anchor or button depending on variable, with same content inside

I want to render in lwc: < a href...> content1 < /a> or < button oncli...> content1 < /button> content1 consists of about 30 lines of code. I don't want to just use if:true ...
0
votes
1answer
17 views

lightning-record-edit-form is throwing an error if user doesn't have the FLS to a field

<lightning-record-edit-form object-api-name={objectApiName} record-id={reviewOutputId} > <lightning-input-field placeholder="Headline" field-name='Headline__c'> </lightning-...
0
votes
0answers
7 views

Jest Mock deleteRecord to throw error

Is it possible to mock uiRecordApi deleteRecord to throw error? it("should show error toast when delete record method throws error", () => { const element = createElement("c-...
0
votes
0answers
11 views

How to retrieve the propertyType parameter from an LWC Flow Component

I have an LWC component, which has a generic type property specified in the meta file like so: <propertyType name="T" extends="SObject" label="Datatable Object API Name&...
0
votes
2answers
26 views

How to set width for lighting-button

I was able to set background and text color based on slds styling hooks but not sure how to set the width: <lightning-button variant="brand" label="View Details" title="...
-1
votes
0answers
11 views

How to add a file upload button(image) in my lwc app and then the save the image in my custom tab?

My aim is to add a button for file upload in my lwc page and when I click it should be able to upload an image to my lwc app.This image should then be displayed in another lwc tab of the app.I have ...
-2
votes
1answer
31 views

window.top.location.reload() in LWC

There's a managed package page in which we can embed a VF Page in a dialog box by giving a custom parameter as VF Page name. There is some functionality as part of which I embedded a custom LWC in my ...
0
votes
3answers
31 views

unable to set the first record as selected in html table

I have HTML table where i am displaying the list of account records and based on the selection of record i am updating the details . I am trying the set the first record radio button as selected on ...
0
votes
1answer
39 views

calling generic method multiple times with different parameters

Is there a way to make this code more optimized, so I have a generic method that process all the logic and it accepts the few parameters and then it adds the key/value to the object displayData I'm ...
-1
votes
1answer
51 views

LWC UI is not updating even though property is updated [closed]

I am working on an LWC component wherein even though the property is changing, UI is being updated. I have a main component with two internal components wholesaler lookup component and warehouse ...
0
votes
1answer
28 views

How to display a preview of an attached pdf file

How to display a preview of an attached pdf file in a new (this is better) or old window using the Apex handler class in LWC. LWC is connected to quick action in salesforce object. As a result, I get ...
-1
votes
0answers
22 views

Display the options for a survey's questions as checkbox,radio button,text or text area [duplicate]

Basic preview of my app Here I have coded in a way that all the options are listed as checkboxes. So when I click each survey all the options are listed as checkbox type.But for each survey, I have ...
1
vote
1answer
44 views

Implement Custom LWC Lookup dependent on a Picklist value [closed]

I'm working on an LWC component where in I have implemented a SLDS table with picklist and a custom LWC lookup component. The ask is, lookup component should filter records based on picklist value ...
-2
votes
2answers
49 views

Bar Chart using ChartJs Lwc [closed]

I have a issues please help me to resolve the same , I am creating bar chart with two datasets I am using chart JS Version 2.8.0 to create a bar chart , on Yaxes i want to shorten the values as there ...
0
votes
1answer
27 views

Download is disallowed. The frame initiating or instantiating the download is sandboxed, but the flag ‘allow-downloads’ is not set. In LWC

Download is disallowed. The frame initiating or instantiating the download is sandboxed, but the flag ‘allow-downloads’ is not set. See https://www.chromestatus.com/feature/5706745674465280 for more ...
0
votes
1answer
28 views

LWC -- Javascript now fully loading before page Load

I have 2 picklist values on a lightning web page. It's RNG if the picklists will have values or not sometimes Division will load, sometimes weatherloss will load and sometimes they both load but its ...
0
votes
1answer
34 views

Input Field Not Updating after calling .replace()

I have an input field on an LWC that should only accept numbers in the range [0-9]. I have a regex and a replace method. But the invalid characters only get removed after I enter a valid one. I could ...
2
votes
1answer
56 views

Is there a way to delete specific field in array?

I am trying to to add this button with function deleteData to delete a specific row on the screen for the UI. So if I have 3 emails listed, it would render 3 on screen. But if I were to click the ...
-1
votes
1answer
23 views

Row Number column is not getting disappeared in LWC data table

Im using a data table. I can see Row index number is visible even if I have removed show-row-number-column <lightning-datatable key-field="Id" ...
0
votes
1answer
25 views

Event Dispatch is not working

I am updating a value for a record using lightning-record-edit-form update in the child component. After updating the record, I want to pass the updated record to the parent. It is not get passed when ...
0
votes
1answer
16 views

window.print(); function opening browse-print window along with image on UI

Using DIV to show/hide an image on BOOL value using window.print() to print.(screen 3). On page load 'ShowImage=false', DIV is hidden. On printImgBtn click browser 'ShowImage=True' and print option ...
4
votes
1answer
35 views

Type is not visible error when deploying a Salesforce Function

I recently got access to Salesforce Functions and I am trying to use the GenericFunctionInvoker.cls class from the functions-recipes repository. FunctionController.cls looks like this: public with ...
-2
votes
0answers
11 views

how to write showmessage function instead of using multiple toastEvent [closed]

Anyone let me know how to write showmessage function instead of every time using const toastEvent import { LightningElement,track } from 'lwc'; import { ShowToastEvent } from 'lightning/...
0
votes
1answer
24 views

I Want to Create List of Folder and whenever I clicking on folder name folder is expand with sub folder and files in LWC [closed]

List Of Folder I created a list of folders trough SOQL SELECT Id, ParentId, Name, DeveloperName, AccessType, IsReadonly, Type, NamespacePrefix, CreatedDate, CreatedBy.name, LastModifiedDate, ...
0
votes
1answer
40 views

Imperative Apex call results in List has no rows for assignment to SObject, anonymous execution works fine

I have the following Apex Method: @AuraEnabled(cacheable=true) public static string test(String ref) { try { Some_Object__c o = [Select Id, Blah__c from Some_Object__c where Blah__c =: ref]...
0
votes
1answer
15 views

datetimepicker opening up and not showing day month selection

I have used lightning-input type="date", however when it opens, it open up when it is zoomed and then hides the rest of the selection and doesn't work properly. Can you please suggest how to ...
0
votes
1answer
19 views

template querySelectorAll -- not able to access values

I am trying to dynamically generate an input form and I need to create a JSON based on the values and nodes created in the input form. I tried to add a class selector with querySelectorAll it returns ...
-2
votes
0answers
19 views

How to display different Input types (Checkbox, Radio Button, Text, Text Area) for different Surveys in my Lightning Survey App [closed]

as I'm new to LWC could someone help me with this? The two images that I have attached are my LWC page and while clicking those 4 listed Surveys, it will show the corresponding Questions and Options (...
1
vote
0answers
40 views

Can I have multiple instances of the same component using a Lightning Message Service channel?

If I create an lwc app component that uses an LMS message channel, will I run into problems if I have multiple instances of that app in a record page? By problems, I mean all instances of the ...
0
votes
2answers
43 views

LWC - apex refresh of data table from data retrieved using @wire

I have a lighting web component datatable that is populated from and @wire call. Below are the key snippets from my code import { LightningElement, api, wire, track } from 'lwc'; import getOrderlines ...
0
votes
2answers
36 views

Embedded lightning-icon onclick event not working

I'm trying to embed an lightning-icon in an lightning-input field to hide/display the password value. <div class="slds-form-element"> <label class="slds-form-element__label&...
0
votes
2answers
29 views

Lightning input not able to render inside iteration

I am trying to iterate a custom metadata to create input fields in the lightning layout item, however it is not rendering as expected, not sure what I am doing wrong. Here is my code: <!-- ...
0
votes
0answers
39 views

How to display different input types(checkbox radio text) according to the user's preference in lwc

This is the current preview of my app where when i click a particular survey the corresponding question and answer is displayed.I want to modify the answers in such a way that answer type can be ...
-1
votes
2answers
42 views

Is that possible to get attribute name from checkbox

I'm wondering if this is possible to get the name of the lightining-input when the component loads and run the isChecked get method. The reason behind is to, make a generic method instead of creating ...
0
votes
0answers
17 views

Delay in Loading Picklist fields (Shipping Country Code) in LWC

Picklist fields are loading post rendering in LWC HTML: <lightning-layout-item size="4" padding="around-small"> <div class="slds-form-element"> &...
0
votes
0answers
22 views

Lightning-button not working to show/hide template section [closed]

I have coded the onclick function of the button to show/hide a section on the page, the function gets called and shows the logs, however the actual component never renders. I tried changing it with ...
0
votes
2answers
21 views

Deploy custom widget with in salesforce

I'm currently working on a project where I need to display a custom widget within the salesforce application. I've custom javascript code that will help me to display the widget as a button. But I'm ...
0
votes
0answers
12 views

How to get the SessionKey/ChatKey in lWC component of the community user chatting with live agent?

This is the chat initiation screenshot.I need to send the name of the visitor whenever I send the message in lwc console. Please help. I tried sforce.console.chat.onChatStarted but this is throwing an ...
-3
votes
0answers
27 views

How to get the current Visitor's User information to lwc component through SOQL in LWC from community [closed]

Can we get the current visitor information in Javascript from which agent is doing that chat? if yes then how? Please help. I want to send it as a JSON to somewhere else.. I just want to know how I ...
-6
votes
1answer
62 views

I am trying to debug LWC in chrome dev console. I am a newbie, guidance please [closed]

I am working on wire service, I get the output on UI (salesforce UI), I want to be able to see the response data in the dev console so that I manipulate the data on template. Usualy we should be able ...
0
votes
2answers
64 views

How To Check If An Object Field Has Changed

I have around few dozens of checkboxes on the page and few other controls but I'm mostly interested to capture if the user have changed the checkbox (meaning if the user checked or unchecked the ...
0
votes
0answers
49 views

How to edit the fields of an object received via Apex in LWC

I need to create html and js code for LWC to edit the fields of a custom object (SendInvoice__c) record, which is obtained through Apex. The default values should be displayed in the editing fields. I'...
1
vote
0answers
34 views

LWC Datatable pagination sometimes returns 0 records

I have a custom LWC datatable (basically extended to support an image column of thumbnails) in which I've also implemented pagination, which is achieved through use of SOQL OFFSET. Given a page size ...
0
votes
1answer
32 views

LWC - dynamically update a datatable column to editable

Just need some help to dynamically update a datatable column to make it editable. In my column definitions - I need to make a stock level column editable based on the results of my @wire call. Stock ...
0
votes
1answer
33 views

How to reset values of a multiselect combo box on click of a button in LWC

In my parent component I'm calling child component as: <c-multiselect-picklist multi-picklist-values={picklistValues} onselect={handleChange} preselected-string={selectedPicklistValue} data-id=&...
0
votes
1answer
30 views

unescape String APEX

Premise: I have a list of string which I have to pass it from LWC to APEX and in APEX I have to put this List in SOQL where clause to get the data. Finally I have to return the SOQL result list back ...
0
votes
0answers
23 views

Require parameter sending between parent-child LWC

Hello i use a custom lookup and i want to pass the require option to the parent. Using LWC components below, it doesn't show required on the input and don't request a value when i save the iNpuT. ...
0
votes
0answers
25 views

Is there any technologies or considerations about using LWC in an offline mode

I have several LWC's components which connect with each other and handle payment operations. I want to know if there are any technologies or considerations about using LWC in an offline mode. I have ...

1
2 3 4 5
113