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.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 3 weeks ago
Add image database to a table
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!
Last updated on Jul, 3rd 2012
You cannot reply to this thread.