Hello,
I’m trying to add a picture (coming from the database) to a table, but I’m not getting.
I’ve watched a few posts here but have not been very useful to me.
Below is the code.
private Table table1 = new Table();
private BaseContainer container;
@Override
protected void initializeComponents() {
//creates a table and sets its columns:
table1 .setSizeFull();
table1 .setStyleName(Runo.TABLE_SMALL);
table1 .setImmediate(true);
table1 .setSelectable(false);
table1 .setColumnReorderingAllowed(false);
table1 .setSelectable(true);
//configures contanier
container = new BaseContainer(table1.class);
table1 .setContainerDataSource(container);
table1 .setVisibleColumns(new Object[]{"name","image"});
table1 .setColumnHeaders(new String[]{"Name","Image"});
//adds the layout
this.addComponent((Component)table1);
}
Class fields
@SuppressWarnings("unused")
@Transient
@Lob
private byte[] image;
@Column(name = "NAME")
@ViewFieldDescClass
private String name;
thanks!