2

can I disable autDestroy on lightning component. Currently in higer version api than 39 customComponent().autoDestroy(false) not working.

I need storage dynamicly created lightning component. This is posible?

Update:

Case - Open tab and open created form field, user can fill part of them without saving he can go to another component and back to my component.

In version 37 api everything working properly but when i switch to 43 api i have js exception with information:

Error in $A.getCallback() [newEntry.autoDestroy is not a function]↵Callback failed:

In api 43 I see that object: enter image description here

In documentation from aura autoDestroy() is still there - so i'm a litle confused.

2
  • How is it "not working"? Can you please provide a working demonstration of what you've tried so far? Any error messages? The more information you give us, the better we can help you. You can edit your question to include additional information.
    – sfdcfox
    Commented Jun 14, 2018 at 18:13
  • @JJanek please can you provide example code?
    – Robs
    Commented Jun 18, 2018 at 14:37

2 Answers 2

0

As stated in documentation dynamically created components should not be getting automatically destroyed. To destroy it you need explicitly call destroy method on component.

Please refere to this link https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/js_cb_dynamic_cmp_async.htm

0

Well i may suggest a workaround... To use localstorage for storing user inputs... Once the component is rerenderd, you may look at the browser's localstorage to prefill the data/form.

You can clear the localstorage once save is successful.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .