Is possible?

Hi again,

I have a doubt, It is possible insert a ColorPicker inside a grid and block it?, I have this: (https://ibb.co/cPz6NJ)
and when I try to insert in a Grid happens this (https://ibb.co/cKYxwd).

You will need to use addComponentColumn to add a component in a column. But what do you mean by blocking it?

-Olli

You need to provide a renderer for the column that shows the color that your data class holds.

My suggestion would be to use an HtmlRender and have it display a small block with the respective color.

See:
https://vaadin.com/download/release/8.4/8.4.4/docs/api/com/vaadin/ui/renderers/HtmlRenderer.html
https://vaadin.com/docs/v8/framework/components/components-grid.html#components.grid.renderer

Olli Tietäväinen:
You will need to use addComponentColumn to add a component in a column. But what do you mean by blocking it?

-Olli

Thank a lot Olli,
That was what I needed. The other thing I want is to block this column so that the user can not modify it

Ronny Edler:
You need to provide a renderer for the column that shows the color that your data class holds.

My suggestion would be to use an HtmlRender and have it display a small block with the respective color.

See:
https://vaadin.com/download/release/8.4/8.4.4/docs/api/com/vaadin/ui/renderers/HtmlRenderer.html
https://vaadin.com/docs/v8/framework/components/components-grid.html#components.grid.renderer

Thank for the reply but I think that the Olli’s answer is more successful to my application. cheers, Carlos.

Have you tried setting the created ColorPicker as disabled?

-Olli

Yes, finally I could, thanks a lot.

You’re welcome!