2016-03-03 131 views
1

下面是我的代碼來創建一個Dojo小部件「app.ThirdWidget」 這大約是ICN的FileNet的瀏覽器小窗口混入#不是調用構造函數

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 

});// 

的包裝,但我的螢火得到以下錯誤,請幫忙:

Error: declare app.ThirdWidget: mixin #4 is not a callable constructor. 


throw new Error("declare" + (cls ? " " + cls : "") + ": " + msg); 

回答

0

這個錯誤說有循環依賴。你應該使用dojo.exports(https://dojotoolkit.org/documentation/tutorials/1.7/modules/)來解決這個問題。

+0

感謝您的回覆,但我使用的是Dojo工具包和ICN小部件庫的模塊,所以我如何刪除循環依賴項,請協助。 – monica13880

+0

你真的必須檢查你的任何模塊沒有循環依賴。它唯一干淨的方式 – xamiro