cancel
Showing results for 
Search instead for 
Did you mean: 

Passing URI Args

cedorfm
Champ in-the-making
Champ in-the-making
Hello,

I am attemption to pass variables from Alfresco Share to Explorer. I was told this was possible via supplying the URI with args.


ALFRESCO SHARE .JS
var site = page.url.templateArgs.site;

var connector = remote.connect();
var result = connector.get("http://localhost:8080/alfresco/service/custom/email-to?" + site);

model.result = result;

ALFRESCO EXPLORER .JS
model.result = args[arg];

I get an error stating "arg" is not defined.
What am I doing wrong here? Is this not possible?

Thanks in advance.
5 REPLIES 5

mikeh
Star Contributor
Star Contributor
"…?siteId=" + encodeURIComponent(site));
Then use
args.siteId

Thanks,
Mike

cedorfm
Champ in-the-making
Champ in-the-making
Works! Thanks alot Mike. I have been trying to figure this out for days.  Smiley Very Happy

cedorfm
Champ in-the-making
Champ in-the-making
One more thing Mike…

What if I wanted to add more than one argument. Can you please give me an example providing multiple args.

Thank you.

mikeh
Star Contributor
Star Contributor
"…?siteId=" + encodeURIComponent(site) + "&param=" + encodeURIComponent(param));
Then use
args.siteId
args.param

Thanks,
Mike

cedorfm
Champ in-the-making
Champ in-the-making
Perfect! Thank you very much.