You need to sign in to do that
Don't have an account?
Passing multiple values to server side apex controller
Hi,
I have passed a single value to my server side apex controller using the following code
action.setParams({ "searchKey" : elemVal });
Now i want to pass one more argument along with elemVal. I tried the following code but i am getting null.
action.setParams({ "searchKey" : elemVal },{"temp" : t}):
Please help
I have passed a single value to my server side apex controller using the following code
action.setParams({ "searchKey" : elemVal });
Now i want to pass one more argument along with elemVal. I tried the following code but i am getting null.
action.setParams({ "searchKey" : elemVal },{"temp" : t}):
Please help
Try the below snippet and let me know if it doesnt solve your issue.
var action = component.get("c.getComponent");
action.setParams({
searchKey:elemVal,
temp: t
});
Thanks,
BaLa
All Answers
action.setParams({ "searchKey" : elemVal });
action.setParams({"temp" : t}):
But then searchkey is showing null value.
Try the below snippet and let me know if it doesnt solve your issue.
var action = component.get("c.getComponent");
action.setParams({
searchKey:elemVal,
temp: t
});
Thanks,
BaLa
Hi Eldon,
That is because you are using setParams twice. You are overwriting the first with the second.
If you want to use multiple calls, use the singular version (setParam, without the trailing s):