Category: communication

Salesforce Lightning Component – Application Event

In continuation to my previous post about component event in Salesforce Lightning, today I would like to discuss about the another type of event i.e. Application event.Application event in Salesforce Lightning follows publish-subscribe model. An application is fired from an instance of a component. All components that provide a handler for the event will be notified once the event is fired. Below diagram will give you a more clear picture -As the above diagram tells – Component 1 is firing the event and that information is getting passed to Salesforce framework. Now all the events – Component 2, 3, 4 & 5 are already registered as handler of this event. So it is now Salesforce framework who will notify all these components that the event has occurred. Here you can see that all the components are very much loosely coupled because when Component 1 is firing the event, it does not know or rather it does not care which component is going to handle that event. Similarly when Component 2 or 3 or 4 or 5 will get notified that the event has occurred, they really don’t know which component has fired the event. This approach makes that component very much loosely coupled.Now I will start with few basic and later I will give you an example to understand Application event.CREATE CUSTOM APPLICATION EVENT:To create Application event, you need...

Read More

Salesforce Lightning Component – Component Event Bubbling Effect

Salesforce Lightning – The Future of Salesforce. Lightning is the collection of tools and technologies behind a significant upgrade to the Salesforce1 Platform. It includes Lightning Component Framework which is used to create reusable components, customize the Salesforce1 App, and also build Standalone apps.The framework uses the event-driven approach communicate with different components. Event is a notification which will let the world/interested entity know that something happened and now they can take actions accordingly. In Salesforce Lightning, the interested entity is the components that you develop. The components will register for the events they are interested and will fire if required. And at the same time there will be components who will handle the events when they are fired. We have two different types of lightning events, as displayed below –Application EventComponent EventIn this post, I will try to explain how Component Events are handled in Salesforce Lightning Framework.Salesforce documentation says, “A component event is always fired from an instance of a component. A component event can be handled by the component that fired the event or by a component in the containment hierarchy that received the bubble event.”I believe this is the best explanation of component event. Later in this post, I will give you an example to explain the bubble effect which I believe is little confusing at this point of time. Let’s wait for some time...

Read More
Loading

Earlier Posts

  • 2024 (27)
  • 2023 (47)
  • 2022 (25)
  • 2021 (35)
  • 2020 (41)
  • 2019 (13)
  • 2018 (16)
  • 2017 (14)
  • 2016 (18)
  • 2015 (74)
  • 2014 (20)