AnsweredAssumed Answered

args from get.js to .get.html.ftl

Question asked by redraccoon on Mar 14, 2017
Latest reply on Mar 14, 2017 by mehe

Hello

I have a simple dashlet 

 

I just woud like to send a custom variable from my file get.js to my freemarker

something like this

 

my files get.js

***********************

function main()
{
var remoteURL = "/dashlet/relance"; //the url of the webscript repo 
var connector = remote.connect("alfresco");
var json = connector.get(remoteURL);
var result = eval("(" + json + ")");

model.allRelances = result.relance;     //this is actually working
var structure = '  {"structure" : [  {  "struct" : "CUSTOM_VAR"  }  ]  }   ';

model.structure = structure;
}

main();

*********************

 

and in my file .get.html.ftl I could use it in condition

 

 

<#if structure.struct??>

<#if structure.struct == "custom_condition">

 

 

 

thank you

Outcomes