I have set up a jsonRPC service:
<xe:jsonRpcService id="jsonRpcServiceKeywords"
serviceName="rpcServiceKey" rendered="true">
<xe:this.methods>
<xe:remoteMethod name="getKeyWordalias">
<xe:this.arguments>
<xe:remoteMethodArg name="key" type="string" />
</xe:this.arguments>
<xe:this.script><![CDATA[var values = getKeywordAliasValues("matterStatus",key);
return values;]]></xe:this.script>
</xe:remoteMethod>
</xe:this.methods>
</xe:jsonRpcService>
The function getKeywordAliasValues returns an SSJS array.
function getKeywordAliasValues(key,values){
var aliasValues = new Array();
// routine to add values to array
return aliasValues;
}
When I call the service frpm client-side javaScript:
var alias = rpcServiceKey.getKeyWordalias("10");
alert(alias)
alert(alias[0])
I get first an object returned. Second the message undefined.
Print statements in my SSJS function confirm that the array contains values.
I assume the SSJS array must be converted to a CSJS array. How must I do this?