PDA

View Full Version : Ruleset onDelete question



Bidmaron
April 25th, 2009, 00:05
I am working on an extension , and I have an application where I need to install a handler for onDelete for a database node. The problem is that when the window is closed, the code goes out of scope and the event doesn't fire when the node is actually deleted elsewhere (the situation is that if you delete the node from the item page, everything works, but if you delete it from the item list the event handler won't fire). In an extension environment, where can I install an event handler that won't go out of scope?

Foen
April 27th, 2009, 19:57
Scripts declared at the top level of the extension file don't go out of scope. In your <base> tag, you can define an inline script or refer to a .lua file: the script runs (an onInit event fires) when the ruleset loads or reloads.

Bidmaron
April 27th, 2009, 22:12
Thanks, foen. I figured this out while I was waiting on a reply. This is kind of key to my other thread about the sound extension.