Sorry for the unnecessary post. Not a problem w/Batik at all, just my lack of event knowledge.
For what it's worth...I was registering the listener directly on the intended target. However, I specified useCapture = true. Reading the w3c DOM spec (!!) revealed "A capturing EventListener will not be triggered by events dispatched directly to the EventTarget upon which it is registered." Setting useCapture = false solved the problem, the listener fires now. What appeared to work earlier was actually confusion with a similar listener's debugging output, a result of inserting test code in the wrong place :( Dan -------- Original Message -------- Subject: EventListener does not respond to DOM mutations if added after document is loaded From: "Dan Slater" <[EMAIL PROTECTED]> Date: Wed, November 19, 2008 11:12 am To: [email protected] Hi, I need to dynamically add or remove an EventListener when the user clicks on an element displayed on a JSVGCanvas. I am trying to listen to DOM mutations. If I use this code prior to calling setDocument, the listener works after the document is displayed: EventTarget t = (EventTarget)elt; t.addEventListener("DOMAttrModified", anchorListener, true); parent.appendChild(typegroup); However, when I add it during the interactive selection process, after the document is already displayed in the JSVGCanvas, it doesn't work: public void setSelectedAttributes(SVGElement elt){ elt.setAttributeNS(null, "selectionstate","selected"); EventTarget t = (EventTarget)elt; t.addEventListener("DOMAttrModified", DX.anchorListener, true); } Of course, the canvas is set to ALWAYS_DYNAMIC. I must be missing a fairly basic concept or command. Can someone please help? Dan Slater --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
