How to add a tooltip for an item or cell in a vaadin table

I noticed that vaadin 6.7.0 beta1 supports adding a tooltip for a row / cell of a table. However, I did not find an example of how to add it. Is there anyone who can provide a sample?

+7
source share
3 answers

Use the code as shown below:

table.setItemDescriptionGenerator(new ItemDescriptionGenerator() { public String generateDescription(Component source, Object itemId, Object propertyId) { if(propertyId == null){ return "Row description "+ itemId; } else if(propertyId == COLUMN1_PROPERTY_ID) { return "Cell description " + itemId +","+propertyId; } return null; }} 
+9
source

You can accomplish this by setting the formfieldfactory. Here you can return a button that will only look like text with CSS style. This will allow you to set the label on the button. This is obviously an ugly hack. Learn more about buttons and links in vaadin .

 table.setTableFieldFactory(new TableFieldFactory() { // container is the datasource // item is the row // property is the column // @Override public Field createField(Container container, Object itemId, Object propertyId, Component uiContext) { }) 
+1
source

You cannot add tooltpis (setDescription) to a row / cell nativly - not yet! This is already a problem, but I donโ€™t know when they will implement this function.

0
source

All Articles