I would like to seek some help with a problem of mine. The table below has 3 columns which are Number, Username and Score. I would like to put in a picture in the username column infront of the username string. The output wil be (picture)user1 etc. The picture will come from a URL. Does anyone know how to go about doing this? Any help will be greatly appreciated. Thank you!
Here is (partial) code I’ve used to put a button displaying an icon in a table column. In your case you could simply replace the Button with a Label that has both an icon and a caption on it. Obviously you wouldn’t need a listener either.
addGeneratedColumn("download_link", new ColumnGenerator() {
public Component generateCell(CustomTable source, Object itemId, Object columnId) {
Button btn = new Button(FontAwesome.CLOUD_DOWNLOAD);
btn.addStyleName(ValoTheme.BUTTON_LINK);
btn.addClickListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
// blah blah blah
}
});
return btn;
}
});