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]

Reply via email to