下面是我创建Dojo小部件的代码" app.ThirdWidget" 这是ICN的Filenet Viewer小部件的包装 -
require([ "dojo/_base/declare",
"dojo/dom-construct",
"dojo/parser",
"dojo/ready",
"dijit/_Widget",
"dijit/_Templated",
"ecm/widget/viewer/FilenetViewer",
"ecm/widget/dialog/ErrorDialog",
"ecm/model/Desktop",
"ecm/model/Repository"],
function (declare, domConstruct, parser, ready, _Widget, template, filenet,errorDialog, desktop, repository){
declare ("app.ThirdWidget",[_Widget, template, filenet,errorDialog, desktop, repository],{
documentID : '',
templateString: '<div >' +
'<div data-dojo-attach-point="containerNode" > <span>third widget</span>' +
'<div data-dojo-attach-point="filenetViewer" data-dojo-type="ecm.widget.viewer.FilenetViewer" style="width: 100%; height: 100%; position: absolute; margin: 0; overflow:hidden" isChildWindow="true"' +
' showNextPrev="false" sideChrome="0"></div>' +
'</div>',
constructor: function(){
alert("Constructor");
},
postCreate : function(){
alert("post Create");
},
startup: function(){
alert("Start up");
}
});// declare
});//
但是我在firebug中遇到错误,请帮助:
Error: declare app.ThirdWidget: mixin #4 is not a callable constructor.
throw new Error("declare" + (cls ? " " + cls : "") + ": " + msg);
答案 0 :(得分:0)
这个错误说,存在循环依赖。您应该使用dojo.exports(https://dojotoolkit.org/documentation/tutorials/1.7/modules/)来解决此问题。