1

Below is my code to create a Dojo widget "app.ThirdWidget" which is a wrapper around ICN's Filenet Viewer Widget-

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

});// 

but I am getting below error in firebug, please help:

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


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

1 Answers1

0

This error says, that there is circular dependency. You should use dojo.exports (https://dojotoolkit.org/documentation/tutorials/1.7/modules/) to solve this problem.

  • Thanks for your response, but I am using the modules of Dojo toolkit and ICN widget library, So how I can remove circular dependencies, Please assist. – monica13880 Mar 04 '16 at 10:23
  • you really must check that any of your modules doesn't have a circular dependency. its the only clean way – xamiro Mar 04 '16 at 14:36