12-25-2009 10:51 PM
<html>
<head>
</head>
<body>
Test dashlet
<div id="treeDiv1">gee</div>
<script type="text/javascript">//<![CDATA[
var tempobject = [ { type: "text", label: "node1" } ];
//instantiate the TreeView control:
var tree = new YAHOO.widget.TreeView("treeDiv1", tempobject);
//render it
tree.draw();
//]]></script>
</body>
</html>
- Registered it12-29-2009 01:09 AM
12-29-2009 10:14 AM
H is null
anonymous() treeview-min.js (line 😎
treenav.js() treenav.js (line 37)
[Break on this error] }else{H.expand();H=(H.children.length||n…&&!C.isFunction(this[E])){this[E]=G[E];\n
treeview-min.js (line 😎
It seem like the problem is that *.js gets executed in the <head> of the rendered page before the <div> tag in the <body> is defined, so there ends up being no place for YUI to put the treeview?01-04-2010 04:07 PM
Alfresco.util.ComponentManager.register(this);
Alfresco.util.YUILoaderHelper.require(["button", "menu", "container"], this.onComponentsLoaded, this);
01-04-2010 05:34 PM
var tempobject = [ { type: "text", label: "node1" } ];
//instantiate the TreeView control:
var tree = new YAHOO.widget.TreeView("treeDiv1", tempobject);
For our response template, we just define the element (<DIV>) and then render (initialize?) the tree within some embedded script:<html>
<head>
</head>
<body>
Test dashlet
<div id="treeDiv1">tree</div>
<script type="text/javascript">//<![CDATA[
//render it
tree.draw();
//]]></script>
</body>
</html>
01-04-2010 06:05 PM
<script type="text/javascript">//<![CDATA[
new Alfresco.DocumentList("${args.htmlid}").setOptions(
{
siteId: "${page.url.templateArgs.site!""}",
containerId: "${template.properties.container!"documentLibrary"}",
usePagination: ${(args.pagination!false)?string},
showFolders: ${(preferences.showFolders!false)?string},
simpleView: ${(preferences.simpleView!false)?string},
highlightFile: "${page.url.args["file"]!""}",
vtiServer: ${vtiServer}
}).setMessages(
${messages}
);
//]]></script>
As you can see, the client-side Alfresco.DocumentList class is being passed parameters through the setOptions() function; parameters which are generated at runtime via Freemarker directives; in turn populated either by the Surf framework or from the web-tier controller script documentlist.get.js. Parameters page.*, template.* and args.* are examples of the former, preferences.* and vtiServer the latter.01-04-2010 06:06 PM
var shareSites = [{ "sites": <#list sites as site>"${site.name}" <#if site_has_next>,</#if></#list> } ];
var tempobject = [ { type: "text", label: "node1" } ];
//instantiate the TreeView control:
var tree = new YAHOO.widget.TreeView("treeDiv1", tempobject, shareSites);
_loadData: function()
{
Alfresco.util.Ajax.request(
{
url: Alfresco.constants.PROXY_URI + "calendar/eventList",
dataObj:
{
"site": this.siteId
},
successCallback:
{
fn: this.onDataLoad,
scope: this
},
failureMessage: Alfresco.util.message("load.fail", "Alfresco.CalendarView")
});
},
01-04-2010 06:17 PM
01-20-2010 03:51 PM
01-20-2010 04:49 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.