xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gary.belc...@blueyonder.co.uk
Subject Re: Calling Javascript From Inside An Applet
Date Sun, 06 Sep 2009 20:47:16 GMT
Helder,

Many thanks for your helpful reply. I got side-tracked with this problem
shortly after posting to the list and have only just got back to looking
at it again! I can get my applet to successfully call the show_alert()
Javascript method in my HTML page if I add an onclick listener for the
circle within my applet's code, but I am also still receiving the
"show_alert() is not defined" message along with the below stack trace:

org.mozilla.javascript.EcmaError: ReferenceError: "show_alert" is not
defined. (Event attribute file:/C:/Circle.svg:-1 onclick#1)
	at org.mozilla.javascript.ScriptRuntime.constructError(Unknown Source)
	at org.mozilla.javascript.ScriptRuntime.constructError(Unknown Source)
	at org.mozilla.javascript.ScriptRuntime.notFoundError(Unknown Source)
	at org.mozilla.javascript.ScriptRuntime.name(Unknown Source)
	at org.mozilla.javascript.Interpreter.interpretLoop(Unknown Source)
	at script(Event attribute file:/C:/Circle.svg:-1 onclick:1)
	at org.mozilla.javascript.Interpreter.interpret(Unknown Source)
	at org.mozilla.javascript.InterpretedFunction.call(Unknown Source)
	at
org.apache.batik.script.rhino.BatikSecurityController$1.run(BatikSecurityController.java:104)
	at java.security.AccessController.doPrivileged(Native Method)
	at
org.apache.batik.script.rhino.BatikSecurityController.callWithDomain(BatikSecurityController.java:108)
	at org.mozilla.javascript.Interpreter.interpret(Unknown Source)
	at org.mozilla.javascript.InterpretedFunction.call(Unknown Source)
	at org.mozilla.javascript.ContextFactory.doTopCall(Unknown Source)
	at org.mozilla.javascript.ScriptRuntime.doTopCall(Unknown Source)
	at org.mozilla.javascript.InterpretedFunction.exec(Unknown Source)
	at org.mozilla.javascript.Context.evaluateReader(Unknown Source)
	at
org.apache.batik.script.rhino.RhinoInterpreter$2.run(RhinoInterpreter.java:290)
	at org.mozilla.javascript.Context.call(Unknown Source)
	at org.mozilla.javascript.ContextFactory.call(Unknown Source)
	at
org.apache.batik.script.rhino.RhinoInterpreter.evaluate(RhinoInterpreter.java:300)
	at
org.apache.batik.bridge.ScriptingEnvironment.runEventHandler(ScriptingEnvironment.java:406)
	at
org.apache.batik.bridge.ScriptingEnvironment$ScriptingEventListener.handleEvent(ScriptingEnvironment.java:1440)
	at
org.apache.batik.dom.events.EventSupport.fireEventListeners(EventSupport.java:324)
	at
org.apache.batik.dom.events.EventSupport.fireEventListeners(EventSupport.java:366)
	at
org.apache.batik.dom.events.EventSupport.dispatchEvent(EventSupport.java:266)
	at org.apache.batik.dom.AbstractNode.dispatchEvent(AbstractNode.java:1014)
	at
org.apache.batik.bridge.BridgeEventSupport$Listener.dispatchMouseEvent(BridgeEventSupport.java:403)
	at
org.apache.batik.bridge.BridgeEventSupport$Listener.dispatchMouseEvent(BridgeEventSupport.java:339)
	at
org.apache.batik.bridge.BridgeEventSupport$Listener.mouseClicked(BridgeEventSupport.java:249)
	at
org.apache.batik.gvt.event.AWTEventDispatcher.processMouseEvent(AWTEventDispatcher.java:633)
	at
org.apache.batik.gvt.event.AWTEventDispatcher.dispatchMouseEvent(AWTEventDispatcher.java:560)
	at
org.apache.batik.gvt.event.AWTEventDispatcher.dispatchEvent(AWTEventDispatcher.java:399)
	at
org.apache.batik.gvt.event.AWTEventDispatcher.mouseClicked(AWTEventDispatcher.java:202)
	at
org.apache.batik.swing.svg.JSVGComponent$SVGListener$12.run(JSVGComponent.java:2120)
	at org.apache.batik.util.RunnableQueue.run(RunnableQueue.java:240)
	at java.lang.Thread.run(Unknown Source)

There seems to be something else that is being triggered when it detects a
mouse click on the circle, but I can't find a way to intercept/override
this and call my own code. Am I missing something here? Or perhaps a
better question is: What happens when Batik detects a user has clicked on
an SVG element that has an "onclick" hyperlink?



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message