Code Comments
Programming Forum and web based access to our favorite programming groups.I like to change am multivaluevield in documenttask.
var document =3D repository.getDocument(variantKey, true);
document.setField('newscategory', ['template']);
document.save();
I get this error:
org.mozilla.javascript.WrappedException: Wrapped =
org.outerj.daisy.repository.DocumentTypeInconsistencyException: The =
value for the multivalue-field "newscategory" should be an array. (#2)
at =
org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1693)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:160)
.. more
How is to set up a java array in this task ??
Thanks for help
Juergen
MSC Vertriebs GmbH
registered office : Stutensee
Jurisdiction and registered Mannheim, Germany, HRB No. 10 3631
Managing Director: Manfred Schwarztrauber, Lothar K=FCmmerlin, R=FCdiger =
Kuhn
Gleichmann & Co. Electronics GmbH
registered office : Frankenthal
Jurisdiction and registered Ludwigshafen, Germany, HRB No. 21305
Managing Director: Manfred Schwarztrauber, Thomas Klein
________________________________________
_______
daisy community mailing list
Professional Daisy support: http://outerthought.org/en/services...rt.html
mail to: daisy-81qHHgoATdGcMQoVcdA18UB+6BGkLq7r@public.gmane.org
list information: http://lists.cocoondev.org/mailman/listinfo/daisy
Post Follow-up to this messageHere's how to set up a java array in javascript http://developer.mozilla.org/en/doc...ide:LiveConnec= t_Overview:JavaScript_to_Java_Communicat ion#Working_with_Java_Arrays Paul On Fri, 2008-06-13 at 15:16 +0200, "Ehms, J=C3=BCrgen" wrote: > I like to change am multivaluevield in documenttask. >=20 >=20 > var document =3D repository.getDocument(variantKey, true); > document.setField('newscategory', ['template']); > document.save(); >=20 > I get this error: >=20 > org.mozilla.javascript.WrappedException: Wrapped org.outerj.daisy.repos= itory.DocumentTypeInconsistencyException: The value for the multivalue-fi= eld "newscategory" should be an array. (#2) > at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:= 1693) > at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:160) > ... more >=20 > How is to set up a java array in this task ?? >=20 > Thanks for help >=20 > Juergen >=20 > MSC Vertriebs GmbH > registered office : Stutensee > Jurisdiction and registered Mannheim, Germany, HRB No. 10 3631 > Managing Director: Manfred Schwarztrauber, Lothar K=C3=BCmmerlin, R=C3=BC= diger Kuhn >=20 > Gleichmann & Co. Electronics GmbH > registered office : Frankenthal > Jurisdiction and registered Ludwigshafen, Germany, HRB No. 21305 > Managing Director: Manfred Schwarztrauber, Thomas Klein >=20 > ________________________________________ _______ > daisy community mailing list > Professional Daisy support: http://outerthought.org/en/services/daisy/s= upport.html > mail to: daisy-81qHHgoATdGcMQoVcdA18UB+6BGkLq7r@public.gmane.org > list information: http://lists.cocoondev.org/mailman/listinfo/daisy ________________________________________ _______ daisy community mailing list Professional Daisy support: http://outerthought.org/en/services/daisy/sup= port.html mail to: daisy-81qHHgoATdGcMQoVcdA18UB+6BGkLq7r@public.gmane.org list information: http://lists.cocoondev.org/mailman/listinfo/daisy
Post Follow-up to this message=EF=BB=BFSo you need to chant the right incantation and hold some chicken=
bones
in the moonlight.=20
Sorry, friday afternoon and all that, here's what you need:
['template'] is not seen as a java array (because, technically speaking,
it really isn't, it's a Javascript array thingy).
To create a Java array, you should write something along the lines of :
var valueArray =3D
Packages.java.lang.reflect.Array.newInstance(Packages.java.lang.String,
1)
valueArray[0] =3D 'template';
HTH,
Karel
ps: you may even need to write Package.java.lang.String('template'), but
I'm not sure.
On Fri, 2008-06-13 at 15:16 +0200, "Ehms, J=C3=BCrgen" wrote:
> I like to change am multivaluevield in documenttask.
>=20
>=20
> var document =3D repository.getDocument(variantKey, true);
> document.setField('newscategory', ['template']);
> document.save();
>=20
> I get this error:
>=20
> org.mozilla.javascript.WrappedException: Wrapped org.outerj.daisy.repos=
itory.DocumentTypeInconsistencyException: The value for the multivalue-fi=
eld "newscategory" should be an array. (#2)
> at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:=
1693)
> at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:160)
> ... more
>=20
> How is to set up a java array in this task ??
>=20
> Thanks for help
>=20
> Juergen
>=20
> MSC Vertriebs GmbH
> registered office : Stutensee
> Jurisdiction and registered Mannheim, Germany, HRB No. 10 3631
> Managing Director: Manfred Schwarztrauber, Lothar K=C3=BCmmerlin, R=C3=BC=
diger Kuhn
>=20
> Gleichmann & Co. Electronics GmbH
> registered office : Frankenthal
> Jurisdiction and registered Ludwigshafen, Germany, HRB No. 21305
> Managing Director: Manfred Schwarztrauber, Thomas Klein
>=20
> ________________________________________
_______
> daisy community mailing list
> Professional Daisy support: http://outerthought.org/en/services/daisy/s=
upport.html
> mail to: daisy-81qHHgoATdGcMQoVcdA18UB+6BGkLq7r@public.gmane.org
> list information: http://lists.cocoondev.org/mailman/listinfo/daisy
________________________________________
_______
daisy community mailing list
Professional Daisy support: http://outerthought.org/en/services/daisy/sup=
port.html
mail to: daisy-81qHHgoATdGcMQoVcdA18UB+6BGkLq7r@public.gmane.org
list information: http://lists.cocoondev.org/mailman/listinfo/daisy
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.