Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#1113 closed defect (invalid)

addOnLoad fires before newly inserted content is loaded in FireFox

Reported by: guest Owned by: bill
Priority: high Milestone:
Component: Widgets Version: 0.3
Keywords: Cc:
Blocked By: Blocking:


When Dojo widgets are inserted into a ContentPane? along with javascript that calls dojo.addOnLoad, the onload code gets executed right away and doesn't wait for the widgets to render. This seems to be a problem in FireFox? and not IE. Here's an example that illustrates the problem.


<html> <head> <script type="text/javascript">

djConfig = {

isDebug: false, disableFlashStorage: true, preventBackButtonFix: false, baseRelativePath: "../js/dojo/"


</script> <script type="text/javascript" src="../js/dojo/dojo.js"></script> <script language="JavaScript?" type="text/javascript">

dojo.require("dojo.widget.ContentPane?"); dojo.require("dojo.widget.SplitContainer?"); dojo.require("dojo.widget.LayoutContainer?"); function mainFunction() {

var contentToBeInserted = dojo.byId('toBeInserted').innerHTML; alert('getting ready to insert the following content:

' + contentToBeInserted);

dojo.widget.byId('contentContainer').setContent(contentToBeInserted); alert('content has been set');


</script> <style>

html, body{ width: 100%; height: 100%; overflow: hidden; padding: 0 0 0 0; margin: 0 0 0 0; }

.dojoSplitPane{ margin: 5px; }

</style> </head> <body>

<div id="contentContainer" dojoType="ContentPane?" layoutAlign="client" executeScripts="true" style="width: 100%; height: 100%;">

This is the starting main content<br> <button onClick="mainFunction()">click me</button>


<div id="toBeInserted" style="display:none;">

<script language="JavaScript?" type="text/javascript">


alert('This is getting called too early in FireFox?!

(just ignore this message the first time through)');


</script> <div dojoType="SplitContainer?" orientation="horizontal" sizerWidth="5" activeSizing="0" style="width: 100%; height: 100%; background: #eeeeee; padding: 10px;">

<div dojoType="ContentPane?" sizeShare="20" style="background:red;">

This is the left pane.

</div> <div dojoType="ContentPane?" sizeShare="50" style="background:green;">

This is the right pane




</body> </html>

Attachments (1)

example.txt (1.9 KB) - added by guest 16 years ago.
This is code that illustrates the problem

Download all attachments as: .zip

Change History (3)

Changed 16 years ago by guest

Attachment: example.txt added

This is code that illustrates the problem

comment:1 Changed 16 years ago by bill

Resolution: invalid
Status: newclosed

Not a bug, use _container_.addOnLoad(). See

comment:2 Changed 15 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.