Questions tagged [parent-to-child]
The parent-to-child tag has no summary.
77 questions
1 vote
2 answers
434 views
LWC modal not receiving recordId
I have an LWC in which I have a datatable. In the datatable I have an action column to show the details of the row and would like to pop up a modal component to show the full record content (too many ...
0 votes
1 answer
44 views
How to restrict parent accounts availability according to the account type?
I have an account hierarchy, that is dependant on the account type(not record type). 'Role' on the image is a picklist, that is actually 'Type'. I need to limit the list of accounts for the parent ...
8 votes
1 answer
1k views
How to inherit css from parent within the child using light dom?
I have a child component that is used to recursively iterate through a tree. The parent component has css that is using the shadow dom and the child component is set to use the light dom. While ...
2 votes
2 answers
4k views
How to style child component from parent component css?
I have two components that have a parent and child relationship. I am trying to apply css from the parent component's css file to the child component without having to write it in multiple places. ...
0 votes
0 answers
125 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 ...
0 votes
1 answer
501 views
LWC - @api property does not render on child component
I have a 4 layers LWC component: great-grandparent > grandparent > parent > child. I want to pass an @api property from great-grandparent to display and modify data in child. Because the ...
0 votes
1 answer
2k views
My child component does not re-render when parent data is changed in LWC
So I have situation where my Parent gets info from Child Component 1 and passes that to Child Component 2. Getting from Child Component 1 to Parent is okay as per console.log(), but my Child Component ...
0 votes
1 answer
46 views
JS api decorative is not working in LWC
the @api decorative is not working in LWC, below is piece of code. the msg is not displaying the text from parent. please help me to fix this error. I am using vs code. parent.html <template> ...
0 votes
1 answer
217 views
How do I check if LWC component has a public method
I have a form with inputs being either standard LWC inputs or custom lookups. I want to validate the form and report error back to the user. I use this.template.querySelector to get the inputs and ...
0 votes
1 answer
174 views
How can you use getSObjectValue() in a child component who's property is declared with @api?
Summary: Is there a way to pass an object from a parent component to a child component so that the child component can use getSObjectValue() to read field values? The naïve implementation fails ...
1 vote
1 answer
720 views
Error handling if no data from parent to child LWC
I am new to salesforce and javascript. I am passing an object from parent LWC to child LWC. but some fields in the object are empty or null. Since I am directly accessing them in the child component ...
0 votes
1 answer
3k views
Advice for validation approach LWC
Hello guys I have being working on a LWC custom form that includes several child components, where each of them contains lightning-inputs, lightning-comboboxes, etc... And in the parent component I ...
0 votes
1 answer
898 views
LWC Run Event Child Then Reun Even on Parent
In my parent LWC I have a modal which displays a child compoent. When the User clicks the Save & Close button I want to fire the Submit event on the Child which then fires a Success Event. Once ...
-1 votes
1 answer
2k views
You have a parent LWC Component A which has two child LWC components B and C. How would you communicate between B and C?
I was asked this question and answered as follows : I would fire a custom event from child B, I would catch the event in the handler of Parent A and retrieve the value in the handler from event.detail ...
1 vote
1 answer
300 views
ChartJS Axes Callbacks not able to be passed from Parent to Child component
I am using ChartJS to display numerical values and I am looking to modify the Axes labels to display with commas. I want to do so by having the chart config look like: var xyValues = [ {x:50, y:7},...