On Jun 24, 6:02 am, chris wade orange
<[EMAIL PROTECTED]> wrote:
> Norris,
>
> Is there any chance you can see what im doing wrong here
>
> im adding 'acro' which is an interface class, that gets extended, and
> I have added the method getField(String); to the interface
> and getField(String) {... } to the extention.
>
> this is the code I use to add it:-
> Object formObj = org.mozilla.javascript.Context.javaToJS( acro, scope );
> org.mozilla.javascript.ScriptableObject.putProperty( scope, "this",
> formObj );
"this" is a keyword and has special meaning; your code here will store
the acro object such that it is only accessible from script by the
expression this["this"] ! Pick another name, like "acro", and then use
that name instead of "this" below.
>
> this is the code that gets sent in:-
> var p = this.getField("principal");var n = this.getField("months");var i
> = this.getField("interest rate");var h = 1;for (var d = 0; d < n.value;
> d++)var h = h * (1+(i.value/12));event.value =
> ("%.2f",(p.value*h*i.value/12)/(h-1));
>
> and this is the exception i get out:-
> TypeError: Cannot find function getField in object [object Object].
> (<javascript>#1)
>
> Can anyone help please?
>
> Kind Regards
>
> Chris
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino