Opened 9 years ago

Closed 9 years ago

#16896 closed defect (invalid)

dynamic load of dijit.layout.TabContainer causes "TypeError: Menu is not a constructor"

Reported by: Joel_Mckay Owned by: Joel_Mckay
Priority: undecided Milestone: tbd
Component: Dijit Version: 1.8.3
Keywords: Cc:
Blocked By: Blocking:


This occurs when the code is dynamically loaded, .parse(), and a js shim is called to process the <script>. It appears to function normally for StackContainer?, but throws a rather odd TabContainer? type error.

I can't seem to trace it with FF 19.0.2 & firebug 1.11.2, and insights into the issue would be appreciated.

Cheers, J

<div style="width: 350px; height: 300px">
    <div id="tabber"></div> 

// This is called after te libs finish load
function showContentWizardArea() {
       var tabnode = dojo.byId("tabber"); 
       var tc =  new dijit.layout.TabContainer({		
// Todo Debug Error: TypeError: Menu is not a constructor
// Source File:
// Line: 458
            style: "height: 100%; width: 100%;",
	    id: "myTabContainer"
        }, tabnode );

	//this works fine
        tc =  new dijit.layout.StackContainer({
            style: "height: 100%; width: 100%;",
	    id: "myTabContainer" 
        }, tabnode );

	var cp1 =  new dijit.layout.ContentPane({
            title: "bug off",
            content: "it should work by now",
            selected: true

//called by shim
       function dbootstrap() {	 

			//stacked box 
			//Tabbed box 
			//load gui after libs ready
			dojo.ready( function (){ 


Attachments (1) (2.9 KB) - added by Joel_Mckay 9 years ago.
main page for testing

Download all attachments as: .zip

Change History (7)

comment:1 Changed 9 years ago by bill

Owner: changed from bill to Joel_Mckay
Status: newpending

Not sure what's going on, although you are loading dojo in a strange way, putting the dojo.require() calls inside a function.

Anyway, please attach a running test case (rather than a code snippet) using the "Attach file" button.

Changed 9 years ago by Joel_Mckay

Attachment: added

main page for testing

comment:2 Changed 9 years ago by Joel_Mckay

Status: pendingnew

Attachment ( added by ticket reporter.

comment:3 Changed 9 years ago by Joel_Mckay

The test case is a flattened version of dynamic auto generated code.

It is rather an odd way of using dojo, and I have been upgrading the back-end for 1.8.3 ...

Cheers, J

comment:4 Changed 9 years ago by bill

Status: newpending

Yah... I tried that test case. After removing:

<script type="text/javascript" src="dijit/dijit.js" data-dojo-config="parseOnLoad: true"></script>
<script type="text/javascript" src="dijit/dijit-all.js" charset="utf-8"></script>

it seems to work fine. I think the lines above are illegal because with AMD you can't just inject your own scripts whenever you want. After removing those lines do you have any other issue?

comment:5 Changed 9 years ago by Joel_Mckay

Status: pendingnew

Thanks for the help Bill, it works and the classes seem to behave better.

I had commented out each line individually, but was unaware these could both be excluded from inclusion. Unfortunately, I don't seem to be able to close tickets myself... =)

Cheers, J

comment:6 Changed 9 years ago by bill

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.