Nov 27, 2016

Sujesh Ramachandran

Refresh component or sections in Lightning component




In the last blog, I have discussed about the advantages of using Inheritance in lightning component (Link). Probably this topic is a bit small technique to just refresh a component rendering section in a lightning component.

Here I am creating 2 components:
1) ComponentContainer.cmp - which will call the Refresh component.
2) RefreshComponent.cmp - Component gets refreshed every time on click of a button on containing component(component 1).

ComponentContainer.cmp has an attribute refreshFlag, which will be set true/false on Refresh button click based on the existing value. The same variable is used in the aura:if to render either the true/false case. Also passing a attribute RefreshCount to just show the effect of refresh in the RefreshComponent.




Here is the output:



Follow me @ramsujesh

Sujesh Ramachandran

About Sujesh Ramachandran -

Co-Founder @ Fingertipplus Technologies | Co-Organizer of Coimbatore Salesforce Developer Group | Full Stack Coder | Blogger

Subscribe to this Blog via Email :

2 comments

Write comments
Raghav
AUTHOR
June 22, 2021 6:10 AM delete

Hello, what is this line component.set("v.refreshComponent", !component.set("v.refreshComponent")) doing?

Reply
avatar