On Tue, Feb 23, 2010 at 10:33, Stefan Bachert <stefanbachert(a)yahoo.de> wrote:
Hi Thomas,
For me it looks that ALL parameter will be converted to STRING
Let's go into concrete
------------ How to be defined -------------
{{velocity}}
#set($list = $xcontext.macro.params.listX)
list = $list
#foreach($x in $list)
item = $x
#end
{{/velocity}}
------------ How to apply -------------
{{velocity}}
#set($list =["aha","oho"])
{{passList listX=$list /}}
#set($list =["aha","oho"])
{{passList listX=list /}}
#set($list ="aha oho")
{{passList listX=$list /}}
{{passList listX="aha|oho" /}}
{{passList listX=["aha","oho"] /}}
{{passList listX="aha","oho" /}}
{{passList listX=[aha,oho] /}}
{{passList listX=aha,oho /}}
{{/velocity}}
-------- this is the output ----------
list = [aha,
list = list
list = aha
list = aha|oho
list = [
list = aha
list = [aha,oho]
list = aha,oho
-----------------------------------
Stefan Bachert
--
View this message in context:
http://n2.nabble.com/macros-and-lists-tp4611119p4617869.html
Sent from the XWiki- Users mailing list archive at
Nabble.com.
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
Ok i see what is the issue here. xwiki/2.0 macro does not in any way
support velocity/java objects. It's only wiki syntax which is parsed
after the velocity block is interpreted so the only thing you can do
is put a proper string in it it's then the macro itself job to parse
each parameter value.
The only ting you can do with velocity here is to generate the proper
macro you could have written without velocity. A good trick to know
what you are doing is to use wiki=false in the velocity macro, that
way you can see what has been exactly generated after velocity
interpretation and before wiki syntax parsing.
--
Thomas Mortagne