How to create link to document in table

I am displaying data in computed fields in a table, with a repeat control. This works great for customizing the ‘view’ of the documents, but I cannot figure out how to create a link to the document. I have tried things likedoc=rowVar.getDocument();

sessionScope.docid=doc.getNoteID(); with no success.