The real difficulty I have is in directly addressing any field of a returned row. I can loop through it and see what each one is, but without doing that and assigning each field based on the iteration count...
I have this problem too. I can't find a good way to handle the list of Objects you get back from a query of which the result spans multiple columns. Foreach seems to internally cast the Object into something it can iterate - it's the only solution I've found, and it's a bit nasty. If anyone has a better solution, let us know! :) #set($results=$xwiki.search("select doc.name, doc.date from XWikiDocument doc",10,0)) {table} doc | date #foreach ($row in $results) #### $row is a java.lang.Object... #### can't figure out how to access the columns except with foreach: #foreach ($col in $row) #if ($velocityCount==1) #set($docName=$col) #elseif ($velocityCount==2) #set($docDate=$col) #end #end $docName | $docDate #end {table}