0

I have a lightning component with 2 buttons, one of the 2 buttons(add button) calls a 2nd component and displays a table on the screen. Once info is populated into the table it can be submitted or the user can cancel out of it.

In both cases if the use click on the add button again it retains the old values. I am trying to refresh the child component so it will lose the values using: $A.get('e.force:refreshView').fire();

(this line was added to the child cmp js controller) but this only refreshes the 1st component with the 2 buttons, the values on the table stay.

How can I update both these components? or just the child component?

0

If the table component is a child component, you can use an aura:method tag. Otherwise you can use a Lightning Event to do this. You will want the result to be rerunning the method in the js controller of the table component that fetches the values action="{!c.init}" or whatever it is.

|improve this answer|||||
  • Is there an example of how to do this? – Muhammad Bajwa Oct 29 '19 at 19:49
  • Both of the links I added have some examples. I can't really give you anything more specific unless I see your code. – nicolevy Oct 29 '19 at 19:52
0

Another thing that might help you is passing the actual data from the parent component to the child component, that way you have full control of what the child component displays.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.