Hello, I have a custom model with many properties, I want to display my custom model into a dashlet so I can edit on this one and have my post content results into the documentLibrary folder.
I get this error : Uncaught TypeError: undefined is not a function Uncaught TypeError: Cannot read property 'attributes' of null
Thanks for your help Regards !
//list-news.js <javascript> if (typeof custom == "undefined" || !custom){ var custom = {}; custom.dashlet = {}; }
(function() { var Dom = YAHOO.util.Dom, Event = YAHOO.util.Event; //var $html = Alfresco.util.encodeHTML; custom.dashlet.list_news = function list_news_constructor(htmlId) { custom.dashlet.list_news.superclass.constructor.call(this, "custom.dashlet.list_news", htmlId); //Register the component Alfresco.util.ComponentManager.register(this); //Load YUI components Alfresco.util.YUILoaderHelper.require(["button", "container", "datasource", "datatable", "paginator", "json", "history", "tabview"], this.onComponentsLoaded, this); return this; }; YAHOO.extend(custom.dashlet.list_news, Alfresco.component.Base, { options: { componentId : "", containerId : "documentlibrary", }, configDialog: null, widgets: {}, onReady: function list_news_onReady() { var me = this; // Add click handler to config news link that will be visible if user // is site manager. var configFeedLink = Dom.get(this.id + "-config-link"); if (configFeedLink) { Event.addListener(configFeedLink, "click",this.onConfigListNewsClick, this, true); } }, onConfigListNewsClick : function list_news_onConfigListNewsClick(e) { var actionUrl = Alfresco.constants.URL_SERVICECONTEXT + "modules/list-news/config/" + encodeURIComponent(this.options.componentId); function computeRedirectUrl(){ var scope = "window.parent.Alfresco.util.ComponentManager.get('" + this.id + "')"; var successCallback = "window.parent.Alfresco.util.ComponentManager.get('" + this.id + "-configDialog')" + ".options.onSuccess.fn"; var failureCallback = "window.parent.Alfresco.util.ComponentManager.get('" + this.id + "-configDialog')" + ".options.onFailure.fn"; var params = { successCallback: successCallback, successScope: scope, failureCallback: failureCallback, failureScope: scope } var url = Alfresco.constants.URL_SERVICECONTEXT + "api/multipartcallback?"; url += "params=" + JSON.stringify(params); return url; } var templateUrl = YAHOO.lang.substitute(Alfresco.constants.URL_SERVICECONTEXT + "components/form?itemKind={itemKind}&itemId={itemId}&htmlid={htmlid}&formId={formId}" + "&destination={destination}&mode={mode}&submitType={submitType}&showCancelButton=true&redirect={redirect}",
(function() { var list_news = new custom.dashlet.list_news("${args.htmlid}").setOptions( { "componentId": "${instance.object.id}", "titleStr": "${title}", "descriptionStr": "${description}", "categoryStr": "${category}", }).setMessages(${messages});
new Alfresco.widget.DashletResizer("${args.htmlid}", "${instance.object.id}");
/* * Créer un évennement lors du click */ var editDashletEvent = new YAHOO.util.CustomEvent("onDashletConfigure"); editDashletEvent.subscribe(list_news.onConfigListNewsClick, list_news, true);
Is there an error in my js ? why I can not see my form on the simpleDialog ? I don't understand why the link is not working and not displaying my form ??? Can anyone help me to achieve my task !!!