Dojox ContentPane and addOnLoad

View: New views
1 Messages — Rating Filter:   Alert me  

Dojox ContentPane and addOnLoad

by XMaNIaC :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

I'm trying to load some page fragment (no html, head or body tags) inside a dojox.layout.ContentPane widget (inside a tab container and loaded with href). This fragment includes several widgets and scripts. Everyhting works but one thing. I have calls to dojo.connect wrapped inside dojo.addOnLoad calls to detect events happening on widgets (for example, on dialog show). They seem to fail when loaded using AJAX because the widget is not ready when the script is evaluated. My guess is that:

  • Scripts are executed before widgets are parsed
  • dojo.addOnLoad is executed directly (the page is loaded after all)

I would like to change this kind of behavior because otherwise I need to clutter the code with something like function whenDialogIsReady(function()...) in addition to the addOnLoad wrapper. How can I force the lazy evaluation of scripts in there? Or how could I change the addOnLoad behavior to wait till the widgets are ready?

Regards

_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://docs.dojocampus.org
Dojo-interest@...
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest