You've got good answers about tooltips from others, so I'll only note that I kinda do tooltips for images by specifying the alt text (showing up as a tooltip doesn't occur in all browsers).
But if you need to create the tooltip from data that isn't already loaded (icodk has hizzen already), then you need to use javascript and ajax calls For the web2py side, look at
<
http://web2py.com/books/default/chapter/29/11/jquery-and-ajax>
(there is some hints about the javascript there, too).
If we haven't answered your question, please give us more information ... workflow, dataflow, steps you expect the user to take, etc.
/dps