For custom objects you have to host it afaik. Right?

@see http://www.mozilla.org/rhino/tutorial.html#definingHostObjects


Regards,

michael

-----Ursprüngliche Nachricht-----
Von:
[EMAIL PROTECTED]
g
[mailto:[EMAIL PROTECTED]
zilla.org] Im Auftrag von chris idr
Gesendet: Freitag, 20. Juni 2008 16:20
An: rhino Dev
Betreff: help with interfaces

Hi 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 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
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to