How to add a combobox in a grid?

Hi all,

I am new to Vaadin.
I was trying to add a combox in a grid.

Code -

Grid grid = new Grid();

grid.addColumn(“Rank”, ComboBox.class );

ComboBox selectRankComboBox = new ComboBox(“”);
Integer rank = new Integer {1, 2, 3, 4, 5};
for (int i : rank){



Attached is the screenshot of the output.
It is showing the Id

How can I display the combox in a grid?

In Grid it is not possible to add component directly to the cell of Grid. Hence the thing you are attempting to do doesn’t work. Instead you could create widget renderer that renders ComboBox or ComboBox like widget (e.g. GWT’s ListBox) in Grid’s cell.

There are couple of example’s here in this add-on.!addon/grid-renderers-collection-for-vaadin7