You need to sign in to do that
Don't have an account?
Aruna Vasahan
Parameter passing from lightning component to controller
Hi guys,
I am now working with napili template. I want to know how to pass parameters from <ui:outputText> in the component area to the controller. Please help me in this. I have gone through all the possible ways but still I'm not able to pass the parameter values.
Thanks
Aruna
I am now working with napili template. I want to know how to pass parameters from <ui:outputText> in the component area to the controller. Please help me in this. I have gone through all the possible ways but still I'm not able to pass the parameter values.
Thanks
Aruna
Let me know if this helps :)
Thanks!
All Answers
Refer below link. You can pass the parameter to controller using .setParams{ "parameterName":"parameterValue"}.
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/controllers_server_intro.htm
Let us know if this helps :)
Thanks!
I refeered the same post and have used the same method to pass parameters but still I am not able to pass the parameters.
client controller
server controller Please refer my code and let me know if bug exists.
Thanks
Aruna
Have you made you Server Controller method @AuraEnabled and controller in your component.
Also, could you please share complete code for controller, component and Server Controller.
Use below code.
Component
Client Side controller.js
Server Controller Method : Also, It is very difficult to debug the problem so you have to be careful while developing lighting components.
Hope this will helps :)
Thanks!
The code which you have posted is working well but can you please find the bug in my code.
Thanks
Aruna
Seems that problem is with below line.
You are setting "expname" hard code as accountId. Replace above line with below line. Everything seems to be working fine.
I tried that way too. But still it's not working. It seems like the parameter is not passing to the server side.
Thanks
Aruna
Problem is with your Controller.js. You are using cmp.get which is not defined.
Use below code
Mark as best if this helps :)
Thanks!
Thanks for showing me the bug !!. My parameter is now successfully passing to the apex controller. But my SOQL query is not working.
I have added a screenshot of it above.
Thanks
Aruna
Let me know if this helps :)
Thanks!
Thank you for the idea, I will try that way to display the details.
Thanks
Aruna