Am Do, den 02.02.2006 schrieb PatrickJ (sent by
Nabble.com) um 12:00:
Suppose I design a skillset application. I define a
SkillClass for
master list of skills. I also define a PersonClass with a DBList
property with query to list Skill items. It works and I could add a
person with multiple skill items selected.
I would like to modify Person page display to show details from Person
object followed by a table that lists his skills along with additional
information from respective skill objects. This table has to list
skill details only for those skills associated with the person.
How do I do this? I tried to pick the associated skills one-by-one
from the property but could not do so with following logic.
#set($skillDoc = $xwiki.getDocument("XWiki.SkillClass"))
#set($perskills=$person.getProperty("SkillList").getValue())
#foreach ($ps in $perskills)
SQL to retrieve skill object
You don't need a SQL statement here, I think. Do the following
#set($obj = $skillDoc.getObject("XWiki.SkillClass", <property>, $ps))
<property> := is the name of the property which store the skill
Display information
$doc.display(<property>, $obj)
<property> := is the name of the property which has the information
#end
Bye
Frank
--
Dipl. Inform. Frank Häfemeier <frank(a)haefemeier.net>
----------------------------------------------------