dynamic caption for buttons in a grid view

I’m Vaadin beginner.
I intend to write a dynamic menu consisting of buttons arranged in grid view.
The captions of those buttons should be set dynamically from a result set of a JPA query.
I guess, it should somehow be possible to bind a button’s caption to a field of a JPA container, where the button might hold an int property referring to the offset within the resultset of the query.

Example:

ResultSet of the query is:

Person

“John”
“Henry”
“Jeffrey”
“Carl”

Grid Layout (2*2) defined as:
Button0 Button1
Button2 Button3

Grid Layout should be desplayed as:
John Henry
Jeffrey Carl

Does anyone have an idea how to bind the captions of the buttons to the values in the result set of the query?
I’m very grateful for every hint!

Hi, did you get a solution to this?