As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
function main() { var json = remote.call("/api/task-instances?state=completed"); if (json.status == 200) { data = eval('(' + json + ')'); } model.data = data.data; } main();
… loadData: function MyDashlet_loadData() { alert(model.data); } …
Alfresco.util.Ajax.request( { method: "POST", url: "/alfresco/service/com/someservice", dataObj: { var1:'value1', var2:'value2', }, successCallback: { fn: function dlA_onActionDetails_refreshSuccess(response) { var rawResponse = response.serverResponse.responseText+""; var obj = eval('(' + rawResponse + ')'); //to do something with this object… } } });
… <script type="text/javascript">//<![CDATA[ var d=new Alfresco.dashlet.MyDashlet("${args.htmlid}").setOptions( { "componentId": "${instance.object.id}", }).setMessages( ${messages} ); <#list data as item> d.setData("${item.id}", "${item.name}", "${item.title}", "${item.state}", "${item.properties.bpm_description}"); </#list> //]]></script> …
… setData: function MyDashlet_setData(id, name, title, state, description) { //just passing data from view to my global array var o = new Object(); o.id=id; o.name=name; o.title=title; o.state=state; o.description=description; tasks.push(o); },