Hello,
I’m trying to initialize an xWiki object with a list and it doesn’t seems to work.
What I’ve tried so far is something like this:
…
#set($object = $doc.newObject(‘Alegere optionale.PachetClass’)) // a new object of PachetClass
#set($list = [])
$list.add($!request.optional1) // where i get the request from a dropwdown and optional1 is the id
$list.add($!request.optional2)
$list.add($!request.optional3)
$object.set(‘optionale’, list)
…
What is wrong here and what is the proper way to do it?
What type of property is “optionale” and what settings did you use for this property?
It was a static list.
In the end we succeeded by getting rid of that list property. Instead of putting an array in the object, we just created one object per each ‘optional’, now just as a string property.