|
Sweet, thanks Simone and Bruno! That fixed it. I'm sending this to the development list too in hopes that someone there will know how to update the 'API notes' section of the following page: http://cocoon.apache.org/2.1/userdocs/widgets/widget_multivaluefield.html Here's the line that ended up working for me: var values = java.lang.reflect.Array.newInstance(java.lang.Class.forName('java.lang.Long'), 3); Thanks again! Brian Bruno Dumon wrote: In addition to this, since your multivaluefield uses "long" as datatype, you should use java.lang.Long, not java.lang.Integer.On Tue, 2006-03-28 at 22:18 +0200, Simone Gianni wrote:Hi Brian, i think java.lang.reflect.Array.newInstance(java.lang.Integer.TYPE, 0); generates an array of int ( http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Integer.html#TYPE ), while the multivalued field probably needs an array of Integer, since internally it gets converted to an Object[] array. Maybe with java 1.5 this would be managed by automatic boxing, but i would recommend to use an array of Integer. This means writing something like var values = java.lang.reflect.Array.newInstance(java.lang.Integer.class, 0); (not sure this works perfectly in _javascript_, otherwise use Class.forName('java.lang.Integer') instead of java.lang.Integer.class). Hope this helps, Simone Brian Maddy wrote: |
