View Full Version : MVC: Many controllers can't control the same event on a view

31 May 2011, 6:04 AM
Hi, I have an application with many views and controllers. One view is shared by many controllers.
Each controller performs a different task when a specific event is fired by the view.
Controllers are listening to the same event using this.control() function.

The problem is: only the first event listener is called while others are ignored.

I looked into the source code of EventBus.js class and I found a for loop in dispatch() method, commented like this: "Loop over all the controllers that are bound to this selector".
But inside there's a return, so I'm pretty sure it's impossible that every controller's listener is executed.