Opened 10 years ago

Last modified 3 years ago

#9954 new defect

dojox.layout.ContentPane parseOnLoad with cross domain

Reported by: vincentastek Owned by: Sam Foster
Priority: high Milestone: 1.15
Component: DojoX Layout Version: 1.3.1
Keywords: dojox ContentPane parse cross domain Cc: vbaudry@…, mumme
Blocked By: Blocking:



I got the following problem with dojox.layout.ContentPane? in cross domain mode.

If a ContentPane? loaded in ajax (after page loading) contents a dojo.require for a dojo type not already required in my main page, I got parsing issue when working in cross domain mode.

It appears that the parseOnLoad:true launches parsing of the ajax loaded content before the dojo.require is processed (that's quite logicial as it's an asynchronous include), so the node using the required dojo type can't be parsed correctly.

I found a workaround by setting parseOnLoad at false on the ContentPane?, and using a custom ContentSetter? to launch the node parsing with the onEnd event. But I think it's reallyt too complicated for a very common need.

Can't this case be correctly managed directly in dojox.layout.container. Is there a simple way to do it that I did not see ?

Thanks a lot,


Attachments (2)

content.html (394 bytes) - added by Richard Palacios 9 years ago.
Content that is loaded in dojox.layout.ContentPane?
main.html (826 bytes) - added by Richard Palacios 9 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 10 years ago by Adam Peller

Cc: mumme added
Owner: changed from Adam Peller to Sam Foster

comment:2 Changed 10 years ago by dante

Milestone: tbdfuture

Changed 9 years ago by Richard Palacios

Attachment: content.html added

Content that is loaded in dojox.layout.ContentPane?

comment:3 Changed 9 years ago by Richard Palacios

My colleague has experienced the same issue and I have attached some additional information that hopefully will help in resolving this quicker. I would personally put this at a higher severity level than currently is.
What this means is that the main page must include every possible widget that can be used by the included page via the ContentPane?'s href. So if my main page's ContentPane? can include 100+ different pages based on a menu selection, then you have to include every widget that the 100+ included pages needs all in the main page.

I attached 2 html files that recreate the issue.

  • main.html contains a dojox.layout.ContentPane? that href's content.html.
  • content.html has a dijit.form.Select widget that gets dojo.require'd in.

The following error is visible in Firebug's console:

dojo.xd.js (line 16) Error parsing in _ContentSetter#Setter_dojox_layout_ContentPane_0_0 Error: Could not load class 'dijit.form.Select'. Did you spell the name correctly and use a full path, like 'dijit.form.Button'? { message="Could not load class ' 'dijit.form.Button'?", more...} ContentPane?.xd.js (line 8) Error undefined running custom onLoad code: already called! [Break on this error] window[(typeof (djConfig)!="undefined"...},onDownloadEnd:function(){}});}}};}); ContentPane?.xd.js (line 8)


Rich P

Changed 9 years ago by Richard Palacios

Attachment: main.html added

comment:4 Changed 9 years ago by bill

Component: DojoxDojoX Layout

comment:5 Changed 8 years ago by Florian

Another vote for putting this to a higher priority: It's really annoying to be forced to put all dojo.require()'d widgets to the index-page just because one deeply nested contentpane may require them later...



comment:6 Changed 7 years ago by ceden

Any update on this?

comment:7 Changed 4 years ago by Caleb Maclennan

I just spent a heck of a lot of time debugging a failing app that ran into this. 6 years and counting later its still a problem in Dojo 1.10 ... is there a way to get this some attention?

Also for reference this happens in same-domain (NOT cross domain) loads in Safari (no problem in FF/Chrome).

Last edited 4 years ago by Caleb Maclennan (previous) (diff)

comment:8 Changed 3 years ago by dylan

Milestone: future1.12

Will look at this for 1.12, but in general, this approach is somewhat of an anti-pattern which is why it hasn't received a lot of attention. dojox/layout/ContentPane's capabilities are pretty much a never-ending game of whack-a-mole in trying to actually load and execute arbitrary content and scripts.

comment:9 Changed 3 years ago by dylan

Milestone: 1.131.15

Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.

Note: See TracTickets for help on using tickets.