Hello, I've created an class with a property defined as a number. Hower, when I retrieve an object in my XWiki document, $doc.display("property", "view", $obj) will return me a String. This prevents my from adding the property values of several objects. So how to retrieve an number property as a number in a XWiki document. Thanks, Joep Janssen
Hi Joep, The displayer has the objective of getting the "html" output of the field. To get the actual value you should use $obj.getProperty("property").getValue() It should return you an Integer object (or Long or Double) $obj.getProperty("property").getValue().intValue() should give you an 'int' Be carefull because velocity only handles 'int' for calculations Ludovic [email protected] a écrit :
Hello,
I've created an class with a property defined as a number. Hower, when I retrieve an object in my XWiki document, $doc.display("property", "view", $obj) will return me a String. This prevents my from adding the property values of several objects.
So how to retrieve an number property as a number in a XWiki document.
Thanks,
Joep Janssen
------------------------------------------------------------------------
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
-- Ludovic Dubost XPertNet: http://www.xpertnet.fr/ Blog: http://www.ludovic.org/blog/ XWiki: http://www.xwiki.com Skype: ldubost AIM: nvludo Yahoo: ludovic
Thanks, That was it! Joep
participants (2)
-
jjanssen@nl.swets.com -
Ludovic Dubost