[email protected] wrote:
When I try to run this I get an error that tells me that person does
not have an "activated" property. I would like to be able to
dynamically add properties to a Java object from within JavaScript Is
this possible? Is there a configuration item I could set to make this
happen? Or is there a particular design idiom I will need to apply to
get this to work?
You need to implement a host object, see
http://www.mozilla.org/rhino/tutorial.html#definingHostObjects
and see
http://mxr.mozilla.org/mozilla/source/js/rhino/examples/Counter.java
for an example.
What you are currently doing is using Java objects in JavaScript via
LiveConnect.
--
Martin Honnen
http://JavaScript.FAQTs.com/
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino