Though a renderer might extend a Component class, it isn't actually part of the 
component hierarchy - rather, it is simply drawn to the screen as needed by a 
skin. As a result, you can't attach tooltips to them as you would a normal 
component.

You can display a tooltip for a particular cell by listening for 
ComponentTooltipListener#tooltipTriggered() and calling TableView#getRowAt() 
and getColumnAt() to determine which cell the mouse is positioned over. Then 
just create and show the Tooltip instance with whatever content you need (e.g. 
a Label).

Here's an example that does something similar for a ListView:

http://svn.apache.org/repos/asf/pivot/trunk/examples/src/org/apache/pivot/examples/tooltips/

G

On Jul 19, 2011, at 5:21 AM, lionel.giltay wrote:

> Hi, I would like to display a specific tooltip in tableview cells. I have a 
> specific renderer that extends Label and that set the text of the label (with 
> model data). I tried to set the tooltip text at the same time I set the text 
> of the Label but the tooltip does not display. Here is my method render code 
> : public void render(Object row, int rowIndex, int columnIndex, TableView 
> tableView, String columnName, boolean selected, boolean highlighted, boolean 
> disabled) { if (row != null) { // Get the row and cell data if (columnName != 
> null) { Dictionary<String, Object> rowData; if (row instanceof Dictionary) { 
> rowData = (Dictionary<String, Object>)row; } else { rowData = new 
> BeanAdapter(row); } Object cellData = rowData.get(columnName); if(cellData == 
> null) { setText("-"); } else if (cellData instanceof ServiceObject) { 
> setText(((ServiceObject)cellData).getId()); setTooltipText("Tooltip 
> ServiceObject"); } } } } I'm using Pivot 1.5.1. Thanks for any help. Lionel 
> View this message in context: Tooltip is not displaying in TableView cell
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Reply via email to