s...@developmentontheedge.com
unread,Mar 13, 2013, 11:31:06 AM3/13/13You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
I pass a function from JavaScript file into Java code. JavaScript function looks like:
entity.handler = function(arg1, arg2) {
//do something
};
In Java code the class implements the Scriptable interface. And when I invoke the JavaScript, actually the following method is invoked in Java:
Scriptable.put(java.lang.String s, org.mozilla.javascript.Scriptable scriptable, java.lang.Object o)
where for my case:
s = 'handler';
scriptable - object whose type is com.beanexplorer.enterprise.operations.js.ScriptableEntity
o - actually is a function, its type is org.mozilla.javascript.gen.c15, ( o instanceof Scriptable ) returns true in debugger.
In the Scriptable.put() method implementation I want to delegate action to the 'o' object:
SomeClass.invoke( new SomeListener(){
@override
public void someAction(int arg1, float arg2) {
//here I need to delegate to the 'o' object.
//do something looked like:
o.call(arg1, arg2); // have no idea how to do it, if it's possible.
}
}
How can I do it? I cannot find any example needed for my case.
Thanks.