I have a remote action method that accepts Set collection as a parameter. How do I pass a set collection from Javascript? I tried passing an array and it gave me an error message.
-------- Class -------
@RemoteAction
global static string forDemo(set<string> names){
// Processing using names
return 'go';
}
-------- VF Page ------
<script>
var lstNames = new Array("Name 1", "Name 2");
<class>.forDemo(lstNames, function(result, event){
console.log(result);
}, {escape: false});
</script>
When I run the page, I get the following error in browser console
Visualforce Remoting Exception: Unable to convert parameter to Apex type: expected SET, got ArrayList
How do I pass a SET collection or can I not use it in Javascript Remoting?