我正嘗試創建一個簡單的Alfresco Dashlet,並在標題欄上啓用了一個編輯按鈕。不幸的是,我無法弄清楚如何讓編輯按鈕在標題欄上實際顯示display。標題欄中的Dashlet編輯按鈕無法正確顯示
這是我到目前爲止有:
dashlet說明文件(.desc.xml)
<webscript>
<shortname>Sample</shortname>
<description>Displays a Sample dashlet</description>
<family>dashlet</family>
<url>/mycompany/components/dashlets/sample-dashlet</url>
</webscript>
我的主要Freemarker模板文件(.ftl)
<script type="text/javascript">
//<![CDATA[
var sampleDashlet = new MyCompany.dashlet.SampleDashlet("${args.htmlid}").setOptions({
"componentId": "${instance.object.id}",
"siteId": "${page.url.templateArgs.site!""}",
"title": "${msg("header")}"
}).setMessages(${messages});
new Alfresco.widget.DashletResizer("${args.htmlid}", "${instance.object.id}");
var editDashletEvent = new YAHOO.util.CustomEvent("onDashletConfigure");
editDashletEvent.subscribe(sampleDashlet.onConfigClick, sampleDashlet, true);
new Alfresco.widget.DashletTitleBarActions("${args.htmlid}").setOptions({
actions: [{
cssClass: "edit",
eventOnClick: editDashletEvent,
tooltip: "${msg("dashlet.edit.tooltip")?js_string}"
}]
});
//]]>
</script>
<div class="dashlet-1">
<div> Test </div>
</div>
似乎問題一定在我的配置某處,但我找不到它。任何人都可以向我指出正確的方向嗎?
您尚未包含MyCompany.dashlet.SampleDashlet客戶端JavaScript組件的實現。這應該駐留在head中引用的JavaScript文件中。 – 2012-08-14 18:01:41