You need to sign in to do that
Don't have an account?
punith narasimha
how to use apex:param tag in lightning component
hi,
in vf page we have a tag i.e apex:param by using this we can pass parameters from vf page to Apex controller
now i want to do same scenario in lightning component please help me
thank u,
in vf page we have a tag i.e apex:param by using this we can pass parameters from vf page to Apex controller
now i want to do same scenario in lightning component please help me
thank u,
u can refer this link https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/controllers_server_actions_call.htm (http:// https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/controllers_server_actions_call.htm)
or either u can check this sample code
------------- Component File-----
<aura:component controller="TestingController">
<lightning:button label="Call server" onclick="{!c.callingServerMethod }"/>
</aura:component>
-----------Client Side Controller File-------
({
callingServerMethod : function(component, event, helper) {
var action = component.get("c.serverMethod");
action.setParams({
"setParams" : "Hello calling server Method",
});
action.setCallback(this,function(response){
var retValueFromServer = response.getReturnValue();
alert(retValueFromServer);
});
$A.enqueueAction(action);
}
})
---------------Server Side Controller File---------
public class TestingController {
@AuraEnabled
public static String serverMethod(String setParams){
return setParams;
}
}
I think this will help you
Thanks....
Greetings to you!
You can use event.getSource() in the client-side controller to get the button/checkbox component that was clicked.
In the client-side controller, you can use one of the following methods to find out which button was clicked.
Below is the sample code which will give you a clear idea about it.
Component:
Controller:
Apex:
Please refer to below links which might help you further.
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/js_cb_which_button_pressed.htm
https://developer.salesforce.com/forums/?id=906F0000000kAn0IAE
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas