Login Register

Chaining DOM event with connect

I'm sorry if its been already answered, couldn't find a relevant topic.

In the example below, bar function never gets called. so how do I chain dom events to other methods other than the original target i.e. on keypress, it should call echo and then bar. it calls echo on keypress but bar never gets called. Is it possible to do this? if so how or any workarounds??? Thanks.


	
		Dojo Events are Great

		
	


function echo(event) {
        key = event.charCode;
        console.debug(event.charCode);
	console.debug("I'm echo");
}
function foo(event) {
        dojo.stopEvent(event);
        console.debug("The link was clicked");
}
function bar() {
    console.debug("I'm bar");
}
dojo.addOnLoad(function() {
        interactiveNode = dojo.byId("interactive");
        linkNode = dojo.byId("link");
        dojo.connect(interactiveNode, 'onkeypress', echo, true);
        dojo.connect(null, 'echo', null, bar);
        dojo.connect(linkNode, 'onclick', foo);
});



        Dojo is great.
        
                 Type some text: