Hi Alex, "this.addListener" adds a listener to the current object. So if you want your reaction object to listen for an event fired on the trigger object "someTrigger", you'll have to use "someTrigger.addListener".
That said, you should look into qooxdoo's data binding API, in particular SingleValueBinding [1]. It will set up this sort of event-based communication between two objects automagically, saving you a bunch of typing. Alternatively, if you want to send a message to multiple objects, the message bus [2] might be of interest. Regards, Daniel [1] http://manual.qooxdoo.org/1.2/pages/data_binding/single_value_binding.html [2] http://demo.qooxdoo.org/current/apiviewer/index.html#qx.event.message.Bus methinks schrieb: > Hi > I'm working on a project where I have two objects that need to communicate > with each other, and I figured the best way would be to use events. I can > get the events working within a single object, but not from one to the > other. > > Trigger Object > -> fireDataEvent("statusUpdate","Message"); > > Reaction Object > -> this.addListener("statusUpdate", function(e) > { > alert(e.getData()); > }, this); > > The problem is that these are in different files. It works when the > fireEvent and the listener are in the same file, but not when they are > separate. > > I'm hoping that this is even possible. > > Thanks > Alex > ------------------------------------------------------------------------------ The Next 800 Companies to Lead America's Growth: New Video Whitepaper David G. Thomson, author of the best-selling book "Blueprint to a Billion" shares his insights and actions to help propel your business during the next growth cycle. Listen Now! http://p.sf.net/sfu/SAP-dev2dev _______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
