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.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Add button to table by QueryContainer
Hi to all,
I need to add three Button over each row of my table to manage each record by that buttons: using IndexedContainer I've no problem to do that but performance is not that I want.
I've to load about 100.000 record from MySql and using QueryContainer is faster, but I can't add the button using this container.
How can I add three Button in three new Coloumn for each record using QueryContainer?
Thanks, Stefano
Use generated columns like in this example - click "View Source", the links in the last column are components.
See also the chapter on Table in the book.
WOW!!!!!
It work perfectly and very faster :lol:
Thanks a lot! ;-)
Have a nice day
Ah, a last question. How can I order my row by coloumn value using QueryContainer?
Thanks, Stefano.
The QueryContainer does not implement Container.Sortable, so the table will not show the sort arrows for it etc. As the query can be an arbitrary (and potentially complex) SQL query, it would be quite hard to implement sorting on top of it reliably.
If something else controls the sorting, you could simply generate other queries and switch the container to a new instance. However, then you might also need to take care of the selection etc.
Alternatively, you could consider using some other database container, such as the JPAContainer (licensed under AGPL or a commercial license) or one of the other containers in the Directory.