Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

How To set a multivalue-field in documenttask
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


Report this thread to moderator Post Follow-up to this message
Old Post
Ehms, Jürgen
06-13-08 02:05 PM


Re: How To set a multivalue-field in documenttask
Here'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


Report this thread to moderator Post Follow-up to this message
Old Post
Paul Focke
06-13-08 02:05 PM


Re: How To set a multivalue-field in documenttask
=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


Report this thread to moderator Post Follow-up to this message
Old Post
Karel Vervaeke
06-13-08 02:05 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Daisy Content Management archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:06 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.