Table - Tooltip for GeneratedRow

Hi,

i have a problem using the ItemDescriptionGenerator for a table using a RowGenerator.
Somehow the Tooltip is neither shown on mouseover nor rendered to the dom tree (as far as i can see).

Here are the snippets from my code:

@Override
    public void akualisiereSuchergebnisseVertrag(Collection<Vertrag> vertraege) {
        akualisiereSuchergebnisse(suchErgebnisListeVertraege, SUCHERGEBNIS_VERTRAG_ROW_GENERATOR, vertraege, null);
        ergebnisTabelle.setSelectable(false);
    }

    @Override
    public void akualisiereSuchergebnissePartner(
            Collection<PartnerSuchTabelle> partner) {
        akualisiereSuchergebnisse(suchErgebnisListePartner, SUCHERGEBNIS_PARTNER_ROW_GENERATOR, partner, VERTRAEGE_ZUR_PERSON_TOOLTIP);
        
        ergebnisTabelle.setSelectable(true);
    }

private <T> void akualisiereSuchergebnisse(
            BeanItemContainer<T> suchErgebnisListe, RowGenerator rowGenerator,
            Collection<T> items, ItemDescriptionGenerator tooltipGenerator) {

        ergebnisTabelle.setContainerDataSource(null);
        ergebnisTabelle.setRowGenerator(rowGenerator);
        ergebnisTabelle.setContainerDataSource(suchErgebnisListe);
        ergebnisTabelle.setItemDescriptionGenerator(tooltipGenerator);        

        suchErgebnisListe.removeAllItems();
        suchErgebnisListe.addAll(items);
    }

private static final ItemDescriptionGenerator VERTRAEGE_ZUR_PERSON_TOOLTIP = new ItemDescriptionGenerator() {
        
        private static final long serialVersionUID = -7784113762417992021L;

        @Override
        public String generateDescription(com.vaadin.ui.Component source,
                Object itemId, Object propertyId) {
            log.debug("property: "+propertyId);
            if(propertyId == null){
                PartnerSuchTabelle partner = (PartnerSuchTabelle) getItemAusTabelle((Table)source, itemId);
                String tooltip = tooltip(partner);
                log.debug("property: "+propertyId);
                log.debug("Tooltip generiert: " + tooltip);
                return tooltip;
            }
            
            return "";
        }
              
    };

public static abstract class FailSafeRowGenerator implements RowGenerator {
        private static final long serialVersionUID = 1L;
        @Override
        public GeneratedRow generateRow(Table table, Object itemId) {
            try {
                return generatedRow(generiereHtmlFuerItem(getItemAusTabelle(table, itemId)));
            } catch (Exception e) {
                log.error("Fehler beim Rendern einer Tabellenzelle", e);
            }
            return generatedRow(StandardFormate.fehlerMeldungInHtml("Fehler"));
        }
        
        private static GeneratedRow generatedRow(String html) {
            GeneratedRow generatedRow = new GeneratedRow(html);
            generatedRow.setSpanColumns(true);
            generatedRow.setHtmlContentAllowed(true);
            return generatedRow;
        }

        protected abstract String generiereHtmlFuerItem(Object itemAusTabelle);
    }

I use the RowGenerator to display some information from my domain objects as a String with HTML formatting.

In my Logging i can see that the generateDescription Method is called and generates the right description. I just wasn’t able to figure out the reason why it is not displayed.

I would be great if someone could give me a hint.

Thanks in advance.

Anybody ?

I’d still be glad about any hint (or alternative solution).

:frowning:

if anyone has found a solution or hint as to how to show a tooltip per row,

please update this thread!