Close
Loading, please wait...
This announcement will hide in 60 seconds

YUI Plugin: Dispatcher

2007-11-25
Dispatcher Manager

The Dispatcher plugin was created to satisfy a very common need of developers using the YUI library: dynamic execution of Ajax response content. Typical strategies to fulfill this need, like executing the innerHTML property or referencing remote scripts, are unreliable due to browser incompatibilities. The Dispatcher plugin avoids those problems.

This component do not required the Bubbling Core Object, only YUI Core, YUI Connection Manager, YUI Dom and YUI Event. And it guarantees these three points::

  • All of the dynamic contents (loaded thru the YUI Connection Manager) will be processed by the Dispatcher, and the javascript chunks will be executed (remote and inline scripts)
  • All the javascripts within a content will be executed according to the order of apparition.
  • All the contents will be included in the DOM's structure before beginning the execution process. This means that you can use references to an element within the container.

The last release of the dispatcher support cross-domains capabilities using the most common technique (proxy), also introduce two new method "jsLoader" and "cssLoader", for remote script and CSS loading onDemand and the hashtable to discard multiple execution for the same remote file, and path-correction for remote files if you need it.

9 Comments

Minor grammar and word use comments

On the page , I noticed a couple simple grammar and word use problems that you might want to know about.

First, the two sentences starting with "The Dispatcher plugin ..." are very hard to digest.

The following is an attempt to rewrite this in a form I can understand (but I may be missing something you're trying tto impart):

The Dispatcher plugin was created to satisfy a very common need of developers using the YUI library: dynamic execution of Ajax response content. Typical strategies to fulfill this need, like executing the innerHTML property or referencing remote scripts, are unreliable due to browser incompatibilities. The Dispatcher plugin avoids those problems.

Second, the phrase "... order of apparition" should probably be "... order of appearance". If you look up "apparition" in the dictionary, you'll see that's not quite the right word.

Comment by David Karr - April 27, 2008

Where to post specific questions

Halo all,
Which type of CMS library specific questions do we post here or should they all go through the YUI group?

Comment by George Aslanis - September 15, 2008

RE: Where to post specific questions

Hey George,

You can post in the YUI Group, or just email me directly.

Comment by Caridy - September 15, 2008

Is this now compatible with YUI 2.6.0?

Have you tested this with the new YUI 2.6.0? Is it compatible?

Comment by Cody Burleson - November 13, 2008

RE: Is this now compatible with YUI 2.6.0?

Hey Cody, the dispatcher 1.5 can work on top of YUI 2.6.0 without any problem. In fact if you check this website, you will see that the bubbling library 1.5 is working on top of 2.6.0.

Anyway, if you have any problem, just let me know.

Comment by Caridy - November 13, 2008

Dispatcher and Layout Manager

I've read elsewhere - on the Yahoo groups I think - that Dispatcher should also work with Layout Manger. I know you don't have any of the specific pre-built stuff finished yet, but it is possible to use it and if so, could you send me a small example?

Thanks

Comment by Dennis - November 18, 2008

Re: Dispatcher and Layout Manager

Hey Dennins:

You're right, in the YUI 2.6.0 I wrote the routines for AJAX within the layout manager (the same routines that we use in the tabview). The dispatcher can extend this functionality to execute the scripts.

Unfortunately this new functionality is not documented yet in the YUI 2.6.0, and also the Bubbling 1.5 don't support it yet.

But here is an example running on top of YUI 2.6.0 and Bubbling Library 2.0 beta.

http://bubbling-library.com/sandbox/yui2/dispatcher/layout.html

If you want more information, send me an email.

Comment by Caridy - November 18, 2008

dispatcher and uploader plugin together

Hi,

I posted this message at YUI Group too.

I try to use dispatcher and uploader plugin together.

I use html file with javascript inside as it is described in 'Advanced Uploader Example With Additional POST Variables and Server Data Return' for Ajax call.

When I try to upload I get 'uploader is not defined'.

Are these two plugins compatible to each other?

any help, please?

Thanks

Comment by Gia - December 16, 2008

RE: dispatcher and uploader plugin together

Hey Gia, I don't see how the dispatcher can affect the uploader utility. Do you have a test case of something where I can dig a little bit?

Also, the only way I see we can use it together is to using distpacher.process to process the response from the uploader. Is that the way you want to use it?

Comment by Caridy - March 18, 2009
Latest Releases

Accordion Manager
This YUI Widget will allow you to create expandable and collapsible areas using the correct HTML and CSS, but without writing a single line of javascript code. (new)

 
Follow Bubbling Library
 
Coming Soon

Bubbling Library for YUI 3.x
A new version of the Bubbling Library compatible with the NEW YUI 3.x. (comming soon)

 
Recommended Reading

Using the YUI TabView Control with the Dispatcher Plugin
YUI Dispatcher Plugin and how to use it along with the YUI TabView to load on-demand content using the YUI Connection Manager.

The Bubbling Technique & Custom Event, YUI’s Secret Weapon
In this article I’ll share my experiences in the event-driven programming within the web browser and show how the Bubbling Library, combined with YUI’s Custom Event capabilities, can create an unobtrusive behavioral layer suitable for powerful web applications.

Event-Driven Web Application Design
I recommend you to read carefully the Christian Heilmann's paper, where he wrote about how to plan an Event-Driven application, and how this technique will become the future of the web application as a result of an evolutive process.

A JavaScript Module Pattern
Eric Miraglia's detailed explanation of how to use the closures and specifically the module pattern (singlenton) as a flexible and multi-funcional structure...

 
Related Links

Yahoo! UI Library (YUI)
YUI Official Website at the Yahoo! Developer Network.

YUI Official Forum
Get help and share your knowledges thru the frenetic javascript mailing list at Yahoo! Developer Network...

 
 
Linux MySql Server PHP Mozilla FireFox FireBug YAHOO! Bubbling Library