Hello,
On Fri, Feb 4, 2011 at 4:46 PM, Lukapt <lukapt(a)gmail.com> wrote:
Hi,
I have created a class with some properties, including a Database List.
What
I want to do is check if some element has been selected for a particular
object of that class.
I'm currently using this velocity code:
#set($obj = $doc.getObject('Space.Class'))
#set($property = $obj.get('propertyName'))
* $property
If your property is set as multiselect, then it is stored as an ArrayList,
otherwise as String.
In the case of ArrayList, this is what you can do:
#set($valueAsList =
$doc.getObject('ClassSpaceName.ClassPageName').getProperty('propertyName').value)
#if($valueAsList.contains('someValue'))
value found ;)
#end
Raluca.
where propertyName is the name of the Database List
property. The result is
a string with all the selected elements in that object.
How could I check if some particular element exists in that property? Could
I iterate over that property?
Thanks in advance.
Best regards,
Luís Braga
--
View this message in context:
http://xwiki.475771.n2.nabble.com/Access-Database-List-elements-tp5992777p5…
Sent from the XWiki- Dev mailing list archive at
Nabble.com.
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs