|
You
might get the error: IncompatibleClassChangeError java.lang.String:?
A
Java String returned to JavaScript is wrapped by a JavaScript
method object. When this object is used in an expression requiring
a string, the wrapper's toString() method is called and
a JavaScript String is returned. Since Array indexing is an implied
polymorphic method (integer index or string property name), the
toString() method is not called and the indexing method fails with
this error. 4.0 handles this however. [4.0]
A
simple workaround in 3.x is to force the conversion to a string.
For
example:
var fred = myAppLet.spouse("wilma")
myDoc.myForm.elements[fred ].clicke// this yields the error
myDoc.myForm.elements[""+fred].clicke
|