cancel
Showing results for 
Search instead for 
Did you mean: 

usage of model in ftl

jeyaa
Champ in-the-making
Champ in-the-making
Hi all,
I am a newbie and working in javascript/ftl. I have written some code in javascript where it get the contents according to its created date. Now in my ftl, i have to show up date wise.

importPackage(Packages.java.util);
importPackage(Packages.com.kpub.web.bean.action);

var report = new ReportGeneration();
var curDate = new Date();

var fdate = report.getFromDate()+"T00:00:00";
var tdate = report.getToDate()+"T00:00:00";

//var spath="'+PATH:\"/app:company_home//*\" + ";

var qdate = "@cm\\:created:[" + fdate + " TO " + tdate +"]'";
var node = search.luceneSearch(qdate);
var nodeList = report.count(node);

model.resultset = node;
model.status = nodeList;

Now I have to create a array of dates from fdate to tdate. And i have to pass it to ftl.

How do i send it to ftl?. Which model attribute I should set for that array?.
Since i don have enough documentation to go through this,
I need to know what are all the attributes present in "model"??.
2 REPLIES 2

invictus9
Champ in-the-making
Champ in-the-making
'model' is the context for all of the top level variables in FTL. From Javascript, set:

model.varray = ['1bc', '2de'];

in order to see 'varray' inside of FTL.

jeyaa
Champ in-the-making
Champ in-the-making
Thanks for your reply.
Is there any link that I could follow up for better understanding of model and its variables?