Jorg Heymans
2004-07-29 14:12:19 UTC
Hi,
I am able to add stuff to the DOM in the update thread
(getUpdateManager().getUpdateRunnableQueue().invokeLater() )
Why is a simple removal then not working like i expect it to work?
I locate the node to remove using document.getElementById , making sure
with getLocalName() and getAttributes() that this is actually the node i
want to remove.
Then in the update thread i am doing
removenode.getParent().removeChild(removenode) which results in
stacktrace ("g" being the element i want to remove)
org.w3c.dom.DOMException: The child node (type: 1, name: g) is missing.
at org.apache.batik.dom.AbstractNode.createDOMException(Unknown Source)
at org.apache.batik.dom.AbstractParentNode$ChildNodes.remove(Unknown Source)
at org.apache.batik.dom.AbstractParentNode.removeChild(Unknown Source)
at com.terrasel.osgis.batikapplet.SVGApplet$2.run(SVGApplet.java:187)
at org.apache.batik.util.RunnableQueue.run(Unknown Source)
at java.lang.Thread.run(Thread.java:534)
The element i want to remove is the one i just dynamically added. I
think i am operating on a recent document instance because i can
actually *find* the element.
Removing static elements always works, so where am I missing the sync on
the document instance?
Any hints?
Regards
Jorg
I am able to add stuff to the DOM in the update thread
(getUpdateManager().getUpdateRunnableQueue().invokeLater() )
Why is a simple removal then not working like i expect it to work?
I locate the node to remove using document.getElementById , making sure
with getLocalName() and getAttributes() that this is actually the node i
want to remove.
Then in the update thread i am doing
removenode.getParent().removeChild(removenode) which results in
stacktrace ("g" being the element i want to remove)
org.w3c.dom.DOMException: The child node (type: 1, name: g) is missing.
at org.apache.batik.dom.AbstractNode.createDOMException(Unknown Source)
at org.apache.batik.dom.AbstractParentNode$ChildNodes.remove(Unknown Source)
at org.apache.batik.dom.AbstractParentNode.removeChild(Unknown Source)
at com.terrasel.osgis.batikapplet.SVGApplet$2.run(SVGApplet.java:187)
at org.apache.batik.util.RunnableQueue.run(Unknown Source)
at java.lang.Thread.run(Thread.java:534)
The element i want to remove is the one i just dynamically added. I
think i am operating on a recent document instance because i can
actually *find* the element.
Removing static elements always works, so where am I missing the sync on
the document instance?
Any hints?
Regards
Jorg