function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Yashita Goyal 17Yashita Goyal 17 

How to pass attribute values to lightning application controller

The structure of code is as follows:

1. Component A has 3 picklist fields and a button
2. On click of button event is fired and control goes on Application controller
3. I want to have these 3 picklist field values which user has selected above in application controller

Can someone please help.

Thanks

Yashita Goyal
Pramodh KumarPramodh Kumar
If you want to pass the variable to the parent component, you have to use the event and which you have to fire and has to handle in your parent controller.

this is the example for the component events
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/events_component_example.htm

application event
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/events_application_example.htm

let me know if you have any questions


Pramodh.
 
Yashita Goyal 17Yashita Goyal 17
The structure of code is somewhat like this:

Application code:
<aura:application>
<aura:attribute name="selObj" type="String"/>
 <c:FilterComponent />
</aura:application>
Filter Component code:
<aura:component>
<aura:attribute name="selectedObject" type="String"/>
</aura:component>

I want the "selectedObject" value to be accessed in application controller in variable "selObj".

In this scenario how will we use event?

Thanks