Skip to main content

Questions tagged [queryselector]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
2 answers
149 views

fflib: selector Method query giving me error of Duplicate field selected

I have created following method in my Opportunity selector class. I am passing my query fields dynamically from another class. public List<Opportunity> selectByDynamicFilter(List<String&...
Pj35's user avatar
  • 38
9 votes
1 answer
2k views

refs vs querySelector in LWC

Some time ago, refs were introduced in Lightning Web Components. Now you can use refs to access elements in shadow DOM and light DOM. Refs locate DOM elements without a selector and only query ...
Piotr Gajek's user avatar
  • 2,784
0 votes
0 answers
95 views

querySelector for extended component does not work

I have a class which extends a Datatable. From there I want to call the child component, but the querySelector is always empty. It is working for other component which are not extended. I want to ...
q-jack's user avatar
  • 192
0 votes
1 answer
415 views

LWC - How to change picklist

How do I change the picklist value to Sold automatically from my JS in LWC? Here's what I have: this.template.querySelector("c-single-select-picklist[data-id='" ...
Ryan McNeely's user avatar
0 votes
1 answer
1k views

Getting value of specified field in lightning record edit form

Can you please help with below issue. i am trying to get name of field or key of lighting record form when phone number is changed. Every time when i try to print the name it's giving name of very ...
Kamal's user avatar
  • 3
0 votes
1 answer
2k views

this.template.querySelector is not returning list of objects in LWC

I have a requirement where I have to make a checkbox checked/unchecked based on the boolean field on Case object. When I am trying to select the element using querySelector, its not returning the list ...
SHUCHI TIWARI's user avatar
0 votes
2 answers
977 views

select all child components LWC

Hello guys I would like to use querSelectorAll() to select all of my child components. They have the followed name: 'c-lwc-Component', 'c-lwc-Search', 'c-lwc-Product'... I was thinking of using this ...
TechGuy's user avatar
  • 117
0 votes
3 answers
466 views

Difference between querySelector() and querySelctorAll()

I would like to know whats the difference between querySelector() and querySelctorAll(). Thanks
TechGuy's user avatar
  • 117
0 votes
1 answer
272 views

lightning-record-edit-form submit issue

I'm trying to iterate over lightning-record-edit-form to update a list of records 1 at a time. It works great until I hijack the submit to change fields before submitting. I've used querySelector to ...
mackmama's user avatar
  • 709
0 votes
2 answers
7k views

.querySelector return value from lightning-input-field based on field-name

I want to have a button on my LWC to validate the values of my lightning-input-field's and lightning-input fields. I am trying to return the value of my lightning-input-fields based on the field-name ...
Jeff Callahan's user avatar
0 votes
1 answer
612 views

Use querySelectorAll on inactive Lightning Tabs

In my LWC form I have multiple lightning-tabs containing several lightning-input-fields. When the form is Approved I would like to allow Users to view, but lock all fields from edit. Unfortunately ...
Jeff Callahan's user avatar
3 votes
2 answers
4k views

LWC querySelector with multiple conditions

I have a few lightning-input in my for:each iterator like code below: <template for:each={records} for:item="record"> <lightning-input data-id={record.Id} ...
MarcelloWrites's user avatar
-1 votes
1 answer
636 views

LWC lightning-textarea dynamically change colors of words

I am trying to add colors to words that starts with '@' as I am typing in js for lightning-textarea. HTML <lightning-textarea class="cssClass" name="input1" label="write&...
kkJhn's user avatar
  • 23
1 vote
2 answers
6k views

LWC get element by value

Why can't I get element by value? I have tried to get id with var, just data and different quotes. //var = id; <lightning-input value={var}></lightning-input> this.template.querySelector(&...
raholed's user avatar
  • 25
-1 votes
1 answer
4k views

Cannot get data-id or value of lightning-input in @api Method in LWC

I'm trying to call Child method from Parent as shown below. When I try to get data-id or value of lightning-input I get undefined. Parent.html <template for:each={tabFieldConfig} for:...
Mr X's user avatar
  • 1
1 vote
1 answer
5k views

Retrieve all lightning-datatable rows

How do I retrieve all lwc lightning datatable rows and not just the ones that are editable. 2 of my columns are non-editable (Section__c & Type__c) (coming from custom metadata) and 3 of my ...
user138847's user avatar
3 votes
0 answers
2k views

How to Target Element In Modal After Opening Modal

I have a custom modal component (with slots) that can be opened and closed. In a parent component I'm using this modal component and inside the body slot of the modal I have a <lightning-input> -...
jbyrd's user avatar
  • 661
0 votes
0 answers
1k views

Best way to call child component in LWC

I am having a html table in my LWC. I have a tooltip displayed on hover on each table row. The content of the tooltip is placed inside the child component. Below is my code. <table class="slds-...
sfMon's user avatar
  • 49
1 vote
0 answers
399 views

How to remove element in a closed lightning-accordion from a QuerySelectorAll

I have multiple lightning-accordion-section each containing a small form I would like to do a querySelector on all my lightning-inputs to make sure that the user filled them properly. If the user ...
Sacha Dieryck's user avatar
0 votes
3 answers
81 views

how to refactor these queries in only one?

I have to transform this method using another method of type Selector. Is it possible to make only one query in this case, respecting each criterion or will I have to create 4 selector's methods? I'm ...
Cline's user avatar
  • 143
0 votes
1 answer
5k views

this.template.querySelector works in parent template but not child template

I'm using the following in Javascript functions in LWC "var uiSection = this.template.querySelector('[data-id="sidebar"]');" to find a UI element with data-id=sidebar. This works ...
RedQueries's user avatar