Hi Robin,
Am Fr, den 24.03.2006 schrieb Robin Fernandes um 17:41:
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))
You can do the following:
select new list(doc.name, doc.date) from XWikiDocument doc
{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:
#set($docName=$row.get(0))
#set($docDate=$row.get(1))
$docName | $docDate
#end
{table}
Bye
Frank
--
Dipl. Inform. Frank Häfemeier <frank(a)haefemeier.net>
----------------------------------------------------