Good evening. I'm having a problem displaying Grails domain object information in a Vaadin grid. This is what i have so far:
contenedorClientes = new BeanItemContainer<Cliente>(Cliente.class, Grails.get(ClientesService).obtenerClientes())
gdClientes = new Grid()
gdClientes.containerDataSource = contenedorClientes
Basically, what i am doing is this: first, i create a BeanItemContainer and then i set this configure this container to be one of type Cliente, and i also set the source of the data for this container which in this case is a method of a Grails service which returns a list of objects of type Cliente.
Then, I instantiate a Vaadin grid and set its containerDataSource to the container created before.
The main problem that i am having is that the grid is also displaying information from the domain class which Cliente extends from. This means that properties like Version, Dirty, Meta Class are being displayed as well. I do not want this, i just want the data from the Domain class that i created to be displayed.
Here is the domain class:
class Cliente {
String nombre
String apellido
String telefono
String email
static hasOne = [usuario:Usuario]
static constraints = {
nombre(nullable: false, blank: false)
apellido(nullable: false, blank: false)
telefono(nullable: false, blank: false, matches: '^\\d{3}-\\d{3}-\\d{4}$', unique: true)
email(nullable: false, blank: false, email: true, unique: true)
}
}
What do i need to do in order to display only the information in this class, and not the one in the super class from which it derives?
Also, does anyone know how to set the order of rendering of the columns in the grid?
Thank you in advance for your help.
I solved this by using the method addColumns of the grid and specifying what columns I wanted to show. No need to remove columns.