Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#469 closed defect (fixed)

Events bug

Reported by: ilia Owned by: alex
Priority: high Milestone:
Component: Core Version: 0.3
Keywords: Cc:
Blocked By: Blocking:


I want to create event that will do something and kill itself

2:35:20: "kill itself" 2:35:24: disconnect itself 2:36:10: it should work only once then die 2:36:45: yeah, it's a pretty common feature request 2:37:03: would probably need support in event.js 2:37:20: I tried a lot of ways, all of them failed or give strange errors 2:37:31: like:

var killer = new function() { = Math.random(); this.go = function() {

node.destroyChild(emptyNode); var _this = this; dojo.debug("disconnecting "; dojo.event.disconnect(document, "onmouseup", _this, "go");



dojo.debug("Connect "; dojo.event.connect(document, "onmouseup", killer, "go");

2:37:44: this should work really 2:38:39: DEBUG: disconnecting 0.04981744068641425

DEBUG: Null argument to unrollAdvice()

2:38:44: its the result 2:39:02: happens when 2 such events are connected then disconnected 2:39:25: that's weird and a bug 2:40:48:

DEBUG: Connect 0.04981744068641425 DEBUG: Connect 0.41351624613931937 --- created 2 handlers -- DEBUG: disconnecting 0.04981744068641425 --- onmouseup 1st one worked --- DEBUG: Null argument to unrollAdvice() -- ouch !!! -- DEBUG: disconnecting 0.41351624613931937 --- that was one more onmouseup --

2:42:01: something strange is going on

Could be very nice to have this fixed cause its a blocker for me

Change History (5)

comment:1 Changed 16 years ago by ilia

Component: GeneralCore

comment:2 Changed 16 years ago by ilia

Priority: highnormal
severity: criticalmajor

Found a workaround.

comment:3 Changed 16 years ago by bill

Resolution: fixed
Status: newclosed

Fredrik fixed this in [4461]

comment:4 Changed 16 years ago by bill

Milestone: 0.4

comment:5 Changed 15 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.