On Apr 3, 11:40 am, [email protected] wrote:
> Hi All,
>
> I have the following problem.
>
> I created two classes...
>
> public class A {
>   public A();
>
>   public void jsFunction_doSmth() {
>     // do something
>   };
>
> }
>
> public class B {
>
>   private A a = new A();
>
>   public B() {
>   };
>
>   public void jsConstructor() {
>   }
>
>   public A jsGet_a() {
>     return a;
>   }
>
> }
>
> then I defined these classes in JS
>
>   ScriptableObject.defineClass(scope, A.class);
>   ScriptableObject.defineClass(scope, B.class);
>
> and then inside JS I'm trying to do the following
>
>   b = new B();
>   b.a.doSmth();
>
> and this gives me an error "Cannot find default value for object".
> But at the same time inside JS I can do something like this
>
>   new A().doSmth();
>
> As i understand it happens because inside jsGet_a() I return an
> instance of java class A and i should return an analog of it in JS.
>
> Can anyone tell me how should I do that.
>
> Thanks in advance and
> Best regards
>
> --H

forgot to write that of course both classes implements Scriptable

_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to