Tomasz149
(Tomasz Pepl)
1
How can I add a link into the table rows?
I have a class which extends Grid
addColumn(PatientInfo::getProgram)
.setCaption("Program"));
addColumn(PatientInfo::getId)
.setCaption("ID"));
How can I add that Program column will contain a link to other website?
K_M
(K.-M. Hansche)
2
You could use an HtmlRenderer:
tbRezepte.addColumn((source) -> {
return MessageFormat.format(VaadinIcons.EXTERNAL_LINK.getHtml() + "\n"
+ " <a href=\"https://www.yyy.org/{0}\" target=\"_blank\">\n"
+ " {0}\n"
+ " </a>\n"
+ "", source.getTitle());
}, new HtmlRenderer()).setCaption("Caption").setExpandRatio(70);
ollit.1
(Olli Tietäväinen)
3
Alternatively, you can use addComponentColumn to add a Link component.
-Olli