Hi!
Now i’m doing the same task: many AWM with relations (like a classic RDBMS scheme).
I’m using a Livetable as a detail list. You can use either a manually created table or a single field.
Put velocity code into Custom Display
property.
For example, i’ts my terrible code
{{velocity}}
#set($collist = ["softID", "softType", "title1", "softVersion", "softLicense", "softComment", "softAdmins"])
#set($colprops = {
"softID" : {"type" : "number"},
"softType" : {"type" : "list", "size" : 100, "class": "SoftwareInventory.Code.SoftwareInventoryClass"},
"softTitle" : {"type" : "text", "link" : "view", "sortable" : true, "filterable" : true, "html" : true},
"softVersion" : {"type" : "text", "size" : 10, "sortable" : true, "filterable" : true},
"softLicense" : {"type" : "text", "sortable" : true, "filterable" : true, "html" : true},
"softAdmins" : {"type" : "text", "sortable" : true, "filterable" : true, "html" : true},
"softComment" : {"type" : "text", "sortable" : true, "filterable" : true, "html" : true}
})
#set($options = {
"className" : "SoftwareInventory.Code.SoftwareInventoryClass",
"tagCloud" : false,
"translationPrefix" : "softwareinventory.livetable.",
"rowCount" : 10,
"selectedColumn" : "softType",
"defaultOrder": "asc"
})
#if($context.action == 'edit')
#livetable("hdwLookUpSoftwareEdit" $collist $colprops $options)
#else
#if ($value != '()')
{{query query="select doc.fullName from XWikiDocument as doc, BaseObject as obj, IntegerProperty as propsoftID, StringProperty as propsoftType where
doc.fullName=obj.name and obj.className='SoftwareInventory.Code.SoftwareInventoryClass' and doc.fullName not like '%Template' and
obj.id=propsoftID.id.id and propsoftID.id.name='softID' and propsoftID.value in $value and obj.id=propsoftType.id.id and propsoftType.id.name='softType' order by
propsoftType.value asc" type="hql"
class="SoftwareInventory.Code.SoftwareInventoryClass"
columns="softTitle,softVersion,softLicense,softComment,softAdmins"
headers="1" links="1" actions="0" /}}
#else
N/A
#end
#end
{{velocity}}
Pay attention to Link
property at
"softTitle" : {"type" : "text", "link" : "view", "sortable" : true, "filterable" : true, "html" : true},