[prev in list] [next in list] [prev in thread] [next in thread] 

List:       batik-users
Subject:    RE: Using ScriptableObject inside IE JavaScript
From:       "Praveen Nayak" <Praveen.Nayak () telelogic ! com>
Date:       2007-12-06 7:41:15
Message-ID: 638CAAC5DA9D0E498950A9B7C380F2E7802388 () semlm-exch ! tlogic ! telelogic ! com
[Download RAW message or body]

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:cam@mcc.id.au] 
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:heycam@jabber.org  ▪  ICQ 26955922  ▪  MSN cam@mcc.id.au

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org 
--------------------------------------------------------------------------------
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: 
Praveen.Nayak@telelogic.com 
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: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic