Questions tagged [lifecycle]
The lifecycle tag has no summary.
10 questions
3 votes
1 answer
105 views
Lightning Tab is not unloaded upon Navigation?
I have an LWC which implements a Lightning Tab, and in the connectedCallback() I setup a document-wide keydown handler to implement an Undo/Redo system. I then added a disconnectedCallback() to ...
3 votes
4 answers
2k views
How to detect Salesforce UI navigation in an LWC
I have an LWC that adds a timer (in connectedCallback) for periodic polling of an imperative apex API in order to do some processing related to the given context (which might be a given record, when ...
0 votes
2 answers
870 views
Why wire adapted doesn't retrieve data?
@wire(fetchCustomSettings) wiredData; renderedCallback() { if (this.wiredData) { console.log('this.wiredData ##', this.wiredData.data); refreshApex(this.wiredData); ...
0 votes
1 answer
418 views
lightning-tabset picking the incorrect variable to set active-tab-value
I have a lightning-tabset with three tabs, problem is the active-tab-value of the lightning tabset, I wish to set it's value based on a boolean value that Im setting in connectedCallback but it picks ...
1 vote
0 answers
204 views
Something is wrong with my code. [LWC Lifecycle hook problem]
I am stuck and unable to figure out a way to get out of this problem. I know I am doing something terribly wrong here. I have two LWC Components - Parent [a container with multiple values to select[...
2 votes
1 answer
2k views
Do something every time an @api property value changes in child component [duplicate]
I am passing a property from a parent to a child component. I am trying to perform a task every time the value passed from a component's parent to itself changes. export default class displayData ...
0 votes
1 answer
9k views
How to refresh the Parent component after a button on child component is pressed?
Problem: I need to have the parent component to make another Apex call, apiCallout(), after the save button is clicked on the child component. That way the UI is displaying current data, however the ...
1 vote
1 answer
915 views
In LWC I cannot use a variable which comes from the parent Aura component
I wrapped an LWC with an Aura component for use it as a quick action and I sent a record's detail from the Aura to the LWC. AuraWrapper: <aura:attribute name="orderRecord" type="...
1 vote
1 answer
1k views
How do I load my data from wire before executing renderedCallback?
I am trying to send an object, accountFields (comes from the wire method), to a method, makeTree, which is called in a renderedCallback. The makeTree renders a tree hierarchy ui component. A ...
1 vote
0 answers
106 views
Lifecycle hook for child component?
I understand lifecycle hooks for a custom LWC. But how do I detect when a child LWC has loaded in the DOM? For example, let's say I have a <lightning-datatable> that is a child of a custom LWC I'...