Table Container
Example code is available on github.com/vaadin-on-grails3/gorm-vaadin-table.
In this tutorial we will show how to display GORM objects in Vaadin Grid.
Step 1
Create a domain object Item
with two String fields name
and other
.
Step 2
Create few records of Item in database in BootStrap.groovy
file.
Step 3
Create instance of Grid
in Vaadin code. We need to do two things to see GORM objects nicely displayed in the grid:
Create new
BeanItemContainer
and add GORM objects into it.GORM object contains more fields then we have defined and we have to pick what columns will be visible. Then we have to remove the others which are not supposed to be visible.
Step 4
Run application and see the table with GORM objects from database.
Last updated
Was this helpful?