Contents
What happens when an event is fired in Lightning aura?
When the event is fired, the handleApplicationEvent action in the client-side controller of the handler component is invoked. The controller retrieves the data sent in the event and uses it to update the messageFromEvent attribute in the handler component. The aeContainer.cmp container component contains the notifier and handler components.
How to create event handler in Lightning aura?
The handler component, aeHandler.cmp, handles the fired event. The client-side controller for aeHandler.cmp sets an attribute in aeHandler.cmp based on the data sent in the event. The event and components in this example use the default c namespace.
How to create an application event in C?
The event and components in this example use the default c namespace. If your org has a namespace, use that namespace instead. The aeEvent.evt application event has one attribute.
Is the name attribute required for application events?
The name attribute is required but not used for application events. The name attribute is only relevant for component events. The button in the component contains a onclick browser event that is wired to the fireApplicationEvent action in the client-side controller.
How are events fired in the Lightning component?
The events may or may not have been triggered by user interaction. In the Lightning Component framework, events are fired from JavaScript controller actions. Events can contain attributes that can be set before the event is fired and read when the event is handled.
Can a salesforce app fire a lightning event?
The Salesforce mobile app and Lightning Experience handle some events, which you can fire in your Aura component. The framework fires several system events during its lifecycle. Sorry, the document you are looking for doesn’t exist or could not be retrieved.