<@markupid='widgets'><@inlineScriptgroup=”dashlets”> var editDashletEvent = new YAHOO.util.CustomEvent('onDashletConfigure'); </@><@createWidgetsgroup=”dashlets”/><@inlineScriptgroup=”dashlets”> editDashletEvent.subscribe(webView.onConfigWebViewClick, webView, true); </@></@>
Setting Object References
To work around this problem the 'webview.get.js' controller sets a reference by including the following object to the widgets 'options' metadata object:
When the <@createWidgets> directive encounters a JSON object with the attributes “_alfValue” and “_alfType” and ONLY those attributes it converts that object into a variable reference instead of a String (effectively it omits the quotes).
PLEASE NOTE: There were many different ways in which we could have solved this problem but based on the perceived frequency of it being required we took this approach, as opposed to (for example) forcing developers to specify all Strings with escaped quotes.
Ultimately the final source for the generated page will contain the following:
Buried in amongst the generated instantiation script for the 'Alfresco.widget.DashletTitleBarActions' widget is the following call to the '.setOptions()' function:
The key thing to notice is that the 'eventOnClick' attribute is being set as an object reference and NOT a String.