On Thu, Jun 23, 2016 at 5:32 PM, D R <rir.ceg(a)gmail.com> wrote:
Hi,
I am currently implementing my first XWiki application and starting to
learn velocity. There is one thing that makes me mad.
There is a static list field with code "ddlProductFamily".
I try to display the items in this list in a nice way
(one below the
other).
It's not very clear what you want to display:
(1) the value of the ddlProductFamily field? i.e. the selected values? Does
this field have multiple selection enabled?
(2) the list of values the ddlProductFamily field can chose from? i.e. the
allowed values, what is specified in the static list definition
In any case you should check
http://platform.xwiki.org/xwiki/bin/view/DevGuide/APIGuide#HAccessobjectsin…
. And before you try to iterate something you should first display/print it
to see if it's really something that can be iterated (a list or an array).
Hope this helps,
Marius
Different approaches including googling didn't lead to any outcome.
#foreach ($prodFam in $ddlProductFamily)
$prodFam\\
#end
#foreach ($prodFam in $doc.display('ddlProductFamily'))
$prodFam\\
#end
On the frontend it's always empty. Other #foreach loops work fine.
I'm sure I just misunderstand something but I can't find the fault myself.
Can somebody please help me?
Thanks in advance,
Dennis
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users