Grid and type class

Hello everyone,
I had in version 7 of the vaadin a screen that worked as a generic for several searches of different models. For example, at one point the screen was searching for cars and at another time, depending on which button, the same screen searched dealerships.
For this screen the table component was used, where the different BeanItemContainer was dynamically set.

With the vaadin 8 and the recommendations of the Mission RIP Table series, I’m trying to change this screen to work with the Grid component.
However this component requires a model in its creation, and every moment I execute

grdTeste.addColumn("C1"); I get this error

java.lang.IllegalStateException: A Grid created without a bean type class literal or a custom property set doesn't support finding properties by name. Is there any way to set the model class at another time after the component is created?

Hi,

nope, you’re not supposed to set the bean type after constructor (even if the relevant methods are available as protected). I’d rather recommend investigating some other overloads of addColumn, for example.

Best regards,

Olli