0

I have one lightning component named "Add/Edit Invoice Line Item" (as seen on screenshot) I want to reload this component every time a user clicks on this tab. Is there any way or event which can be used to handle this? Screenshot

5
  • what have you tried so far? Commented Jun 25, 2019 at 16:34
  • Tried the refresh view event but that does not work if I do any change in related list records tab and also tried the following events but didn't work. developer.salesforce.com/docs/atlas.en-us.api_console.meta/… Commented Jun 25, 2019 at 16:41
  • Did you try a change handler? developer.salesforce.com/docs/atlas.en-us.lightning.meta/… On what kind of changes should your component refresh?
    – Johannes
    Commented Jun 25, 2019 at 17:05
  • you can achieved by using workspaciAPI if you can post your component code, it' ll help us to give exact solution to you
    – sdandamud1
    Commented Jun 26, 2019 at 14:29
  • Hey Sadanadamud1 , I have tried using WorkspaceAPI events but those are not working here, I think that works with the Lightning console not within a lightning page. Commented Jun 28, 2019 at 7:31

2 Answers 2

1

lightning:tab by default will load only 1st time when it gets focus - there-by rendering the content/component in its body. Even when you navigate away from that tab, the content will just be hidden but not unrendered.

Workaround: aura:if will render/unrender content in it depending on the condition. So use aura:if inside each tab. The condition can be {!v.selectedTabId=='tab1'}. You can set the selectedTabId by using onactive on lightning:tab.

0

Thanks for your help!

I have searched for the solution for 2 days (asked multiple people and checked documentation) but couldn't find anything. So I have added an idea for salesforce to provide developers with Accessible Lightning Events from Lightning Page. If you think this Idea can be useful to you as a developer the please upvote.

Idea: Accessible Lightning Events from Lightning Page. (https://success.salesforce.com/ideaView?id=0873A000000CZbzQAG)

Thanks

You must log in to answer this question.

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