Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
grid.setCellDescriptionGenerator - help needed
I am trying to display a tooltip in a grid cell vaadin 7.6 and it doesn't work here is my code - can anyone help?
grid.setCellDescriptionGenerator(new Grid.CellDescriptionGenerator() {
@Override
public String getDescription(Grid.CellReference cellReference) {
String tooltip = "";
if (cellReference.getPropertyId().toString().equalsIgnoreCase(CREATED_DATE)) {
String tt = (String) cellReference.getItem().getItemProperty("createdDateToolTip").getValue();
tooltip = tt;
} return tooltip;
}
});
Can you please elaborate a little more?
Is the Grid.CellDescriptionGenerator() not invoked at all or is it invoked and processed correctly but the tooltip is not shown on the browser?
Sorry, I don't know - how do I find out?
the tooltip isn't shown anyway
The best way is to attach your IDE debugger and place a breakpoint inside the getDescription method.
If you prefer an old style dirty way, place some System.out.println("...") inside the method and then check the console output
Can you please post some more code? How do you setup the grid and the container?
It is still null
more info:
IndexedContainer container;
Grid grid = new Grid() {
public Component getSearchResultComponent(ViewChangeListener.ViewChangeEvent event) {
container = new IndexedContainer();
container.addContainerProperty("addOrRemove", String.class, "");
container.addContainerProperty("export", String.class, "");
container.addContainerProperty("createdDate", Date.class, null);
container.addContainerProperty("lastUpdatedDate", Date.class, null);
for (TRVo vo : tRVOs) {
Item newItem = container.getItem(container.addItem());
newItem.getItemProperty("createdDate").setValue(vo.getCreatedDate()); newItem.getItemProperty("lastUpdatedDate").setValue(vo.getLastUpdatedDate());
grid.setSizeFull();
GeneratedPropertyContainer gpc = new GeneratedPropertyContainer(container);
grid.setContainerDataSource(gpc);
It seems your container has not "createdDateToolTip" property
Same way you have done for **createdDate** or **lastUpdatedDate** properties.
What do you want to set as tooltip for CREATED_DATE cell? a property of your TRVo bean named createdDateToolTip or must it be a text you generate based on other properties?
I got a string displaying as a tool tip! Thanks
so there is some problem with the getItemProperty - that can wait!
Can you help me with displaying an image in a grid please?
Take a look at the documentation for the Grid component; in the section Column Renderers you will find what you need.
I'm getting there - now I am looking for combining image and text in a cell!