[daisy] Strangeness with multivalue-fields
Caleb Callaway
caleb at autometrix.com
Tue Apr 3 15:18:36 CDT 2007
Beautiful. Thanks guys!
-----Original Message-----
From: daisy-bounces at lists.cocoondev.org
[mailto:daisy-bounces at lists.cocoondev.org] On Behalf Of Bruno Dumon
Sent: Tuesday, April 03, 2007 12:01 AM
To: Daisy: open source CMS - general mailinglist
Subject: Re: [daisy] Strangeness with multivalue-fields
On Tue, 2007-04-03 at 08:25 +0200, Marc Portier wrote:
> Caleb,
>
> I haven't tested this myself but I would suspect the mild difference
> between javascript and java arrays to be causing this.
> (So it's an array in javascript land, but when passed to the Java API
> it is seen as one single javascript native object)
>
>
> here is how you can create a java string array from within javascript
>
> var stringClass = java.lang.Class.forName("java.lang.String");
> var vals = java.lang.reflect.Array.newInstance(stringClass, 1);
> vals[0]="X5";
No need for Class.forName, this should also work:
java.lang.reflect.Array.newInstance(java.lang.String, 1);
BTW, the second argument (1) is the size of the array.
See also the Rhino documentation at
http://www.mozilla.org/rhino/doc.html
--
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno at outerthought.org bruno at apache.org
_______________________________________________
daisy community mailing list
Professional Daisy support:
http://outerthought.org/site/services/daisy/daisysupport.html
mail to: daisy at lists.cocoondev.org
list information: http://lists.cocoondev.org/mailman/listinfo/daisy
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.25/743 - Release Date: 4/2/2007
4:24 PM
More information about the daisy
mailing list