I can't help you with tacos, but if you use Tapestry 4.1 to load your widgets they will all be contained in a single initialization block as the portion of the framework having to do with managing _javascript_ now uses dojo to do these kinds of things. (Yes it does appropriately load things when doing normal html vs XHR requests).

I know that doesn't help you, but couldn't resist the urge to point it out.

On 7/26/06, Sam Gendler < [EMAIL PROTECTED]> wrote:
I have some pages that have a number of accordions on them, each of
which may have as many as 10-15 content panes contained within.  Due
to the nature of the component framework (tapestry/tacos) I am using
to create the dojo widgets, each widget adds its own call to
dojo.addOnLoad () which causes the widget to be instantiated via a
_javascript_ call to createWidget().  As a result, on some pages which
have particularly high widget counts, I get unresponsive script
warnings from both IE and firefox.  I should add that the servers are
in Munich and testing is in California, so network latency could be an
issue, particularly since I am not using a custom build of dojo, and I
don't believe I have the widgets included.  I could create a custom
build, except that in order to fix a number of bugs in dojo, I was
forced to subclass some of the widgets (yes, I've submitted patches.
No they haven't been included in later builds.  Yes, I've signed the
necessary docs).  So I will be downloading some files via
dojo.require() even with a custom build.

Honestly, I don't know if the warnings are a result of many downloads
over a high latency connection or the many calls to dojo.addOnLoad().
In either case, it would be great to have a solution.

I've cross posted this to dojo and tacos lists.

For the tacos folks, is there some sneaky way I could actually get all
dojo widgets to render a single dojo.addOnLoad() call?  Perhaps I
could pass a different writer to scripts within dojo based components
somehow?  I would need a separate addOnLoad() call for each block of a
script file (body, initialization, etc.  Actually, just those two
would do).  It would make for much cleaner generated code if I could
do that.

For Dojo folks, is there some way to push modules defined outside of
dojo into a dojo.js file?  I really don't want to copy things into the
dojo tree, as that will make it very difficult for users outside my
company (we've submitted the source to our widgets to a public, open
component library), since we'd have to instruct users how to merge the
external and dojo source libraries.  Also, is there anything we can do
to make the browser realize that a script is just executing?  Perhaps
return control to the browser periodically?  For instance, if the
onLoad mechanism were to return to the browser after each function is
executed, and then go back after executing a 0 length timer, not much
latency would be added, but the browser would probably be tricked into
thinking the script is 'responsive.' I could implement my own onLoad
mechanism that does this, of course, and then add it in a single
dojo.addOnload () call, but I'd prefer not to, if I can avoid it.

--sam
_______________________________________________
Dojo FAQ: http://dojo.jot.com/FAQ
Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
[EMAIL PROTECTED]
http://dojotoolkit.org/mailman/listinfo/dojo-interest



--
Jesse Kuhnert
Tacos/Tapestry, team member/developer

Open source based consulting work centered around dojo/tapestry/tacos/hivemind.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Tacos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tacos-devel

Reply via email to