Hi, I want to execute this in the script hosted within IE. I still do not know how I can call Context.something, because in IE "Context" will be undefined.
Also, the browser instance which wants to call the method doesn't have an applet in it (it was a spawned instance). Can you tell me how to get hold of the "Context" class in IE Javascript? Thanks, Praveen -----Original Message----- From: Cameron McCormack [mailto:[EMAIL PROTECTED] Sent: Thursday, December 06, 2007 12:13 PM To: batik-users@xmlgraphics.apache.org Subject: Re: Using ScriptableObject inside IE JavaScript Hi Praveen. Praveen Nayak: > I have an applet with the Batik viewer. > I am doing a window.showModalDialog (by getting a handle to the window > from the applet) from inside the SVG's script and passing an object I > create inside the SVG's script. I have attached an example in the zip > file. > > The modal window tries to access a property of the object and call a > method. > > Accessing the property works. > But, even calling the method by passing an empty object > > srcObj.callMethod(scrObj, "objectMethod", new Object[0]); > > doesn't work. Is there something else I should be doing? > > Also, at this point I wanted to know about creating Java objects in > Javascript because a lot of methods expect a Context to be passed. I > don't know how to get hold of one. So, I think it’s difficult to seamlessly integrate IE’s script objects with the ones from Rhino running in the applet. One particular issue is the threading; if you call a function or evaluate some script on Rhino’s script object, then you need to use that Context object to ensure that it is run in the same thread as the rest of the script in the SVG document. I think you use the static Context.call(ContextAction) method, http://www.mozilla.org/rhino/apidocs/org/mozilla/javascript/Context.html#call(org.mozilla.javascript.ContextAction) to run arbitrary code within the context (and use Context.getCurrentContext() to get a Context instance to pass to callMethod). -- Cameron McCormack, http://mcc.id.au/ xmpp:[EMAIL PROTECTED] ▪ ICQ 26955922 ▪ MSN [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -------------------------------------------------------------------------------- Telelogic Lifecycle Solutions: Helping You Define, Design & Deliver Advanced Systems & Software Learn More at www.telelogic.com Praveen Nayak Technical Leader Telelogic India Pvt Ltd #58, 1- 4 HM Towers, Brigade Road, 560 025 Bangalore India Phone: +91 (80) 419 95800 x327 Fax: Mobile phone: [EMAIL PROTECTED] http://www.telelogic.com Telelogic - Requirements-Driven Innovation! ------------------------------------------------------------- The information contained in this e-mail, including any attachment or enclosure, is intended only for the person or entity to which it is addressed and may contain confidential material. Any unauthorized use, review, retransmissions, dissemination, copying or other use of this information by persons or entities other than the intended recipient is prohibited. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]