Hi, I added an image with table using ‘setIconProvider’ method. I need to add, on click invoke functionality on that image and want to show the popupView on that click. Is it possible to do the same.
Hello!
I suggest that you use Table Column generation ability and use the Embedded component.
To add click listener you should unwrap the Embedded component and use Vaadin API:
table.addGeneratedColumn("image", new Table.ColumnGenerator() {
@Override
public Component generateCell(Entity entity) {
Embedded embedded = componentsFactory.createComponent(Embedded.class);
// set an image to the embedded
com.vaadin.ui.Embedded vEmbedded = embedded.unwrap(com.vaadin.ui.Embedded.class);
vEmbedded.addClickListener(clickEvenet -> {
// show popup
});
}
});
To open a popup you should use openWindow with OpenType.DIALOG