Reputation: 901
I want to run SSJS from CSJS script library... This command works fine in Client Side JavaScript library:
var myVar = "#{javascript:getComponent('myCustomControl').getPropertyMap().property1 = 'test'}";
When I check custom control property1 from SSJS it shows test. So works fine. But I need to substitute 'test' value with some variable, like:
function myFunction(testID){
var myVar = "#{javascript:getComponent('myCustomControl').getPropertyMap().property1 = '" + testID + "'}";
}
Now when I check customcontrol property1 property it says exactly
'" + testID + "'
so it doesn't calculate/substitute
Upvotes: 0
Views: 1719
Reputation: 1022
Syntax error.
You have the double-quotes enclosed in single quotes when setting the value.
'" + testID + "'
If you need the value of testID in quotes, use
'"' + testID + '"'
If you just need the value of testID just use
testID
Amiright?
Upvotes: 0
Reputation: 284
I created a video tutorial on how to run SSJS from Client Side JavaScript using Remote Services. It's extremely powerful and allows you to pass parameters and return various objects back to CSJS for processing.
Click here to watch this video tutorial on NotesIn9.com
Upvotes: 4