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 <[email protected]> ----------------------------------------------------
Thank you. I understand your logic that does not require SQL - by getting reference to all the documents with skillclass and then matching it on property. This is good and follows the spirit of velocity. However, I get null value from $person.getProperty("SkillList").getValue(). Is there some different way to retrieve values from a DBList property? -- View this message in context: http://www.nabble.com/DBListClass-and-Details-t1046024.html#a2733652 Sent from the XWiki- Users forum at Nabble.com.
participants (2)
-
Frank Haefemeier -
PatrickJ (sent by Nabble.com)