AnsweredAssumed Answered

roothome undefined in javascript controller for dashlet

Question asked by ashokharnal on Sep 15, 2011
Latest reply on Sep 17, 2011 by ashokharnal
I have the following two-lines simple code in JavaScript Controller while creating a dashlet in Alfresco Share:

var folder = roothome.childByNamePath("Sites/myoffice/documentLibrary/AURC Space/DEO/Drafts") ;
model.folderlength = folder.children.length ;

However, an error that 'roothome' is not defined  appears in the  dashlet in Alfresco Share as:

"Exception: org.mozilla.javascript.EcmaError - ReferenceError: "roothome" is not defined. (file:/home/Alfresco/Alfresco/tomcat/shared/classes/alfresco/web-extension/site-webscripts/org/alfresco/components/dashlets/knowledgebase.get.js#1)"

My objective is to count the number of documents in a folder and publish them in the dashlet.

What is the problem? I will be grateful for help.

Outcomes