Components inside a table

In a table I have TextField, DateField and Select component, added in this way:

		addContainerProperty("numTratta", String.class, null);
		addContainerProperty("tmsInizio", DateField.class, null);
		addContainerProperty("tmsFine", DateField.class, null);
		addContainerProperty("desPartenza", String.class, null);
		addContainerProperty("desArrivo", String.class, null);
		addContainerProperty("qtaDistanza", String.class, null);
		addContainerProperty("desMezzoTrasporto", Select.class, null);

When I make the table non editable, only String components become non editable, while DateField and Select stay editable. How can I make them not editable?
Thank you, Francesco

How about using Date instead of DateField as container properties? That way the table will show the date when table is setEditable(false) and automatically change it to a DateField when you call table.setEditable(true);


package com.example.playground;

import java.util.Date;

import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Label;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;

public class PlaygroundApplication extends Application {
	private static final long serialVersionUID = 6031735832707957247L;

	public void init() {
		VerticalLayout mainLayout = new VerticalLayout();
		Window mainWindow = new Window("Playground Application", mainLayout);
		Label label = new Label("Hello Vaadin user");
		IndexedContainer container = new IndexedContainer();
		container.addContainerProperty("one", String.class, null);
		container.addContainerProperty("two", Date.class, null);
		Item item = container.addItem("1");
		Item item2 = container.addItem("2");
		Date date = new Date();
		Date date2 = new Date();
		final Table table = new Table("foo", container);
		mainWindow.addComponent(new Button("click", new ClickListener() {
			private static final long serialVersionUID = -8648939862617861344L;

			public void buttonClick(ClickEvent event) {

Thank you Jens, I’ll try.
And what about Select component? How can I make it non editable?
Thank you, Francesco

Solved: I extended DefaultFieldFactory and in the createField method I return a Select Field. In this way setEditable automatically change components in editable or non editable mode.
Great framework!
Thank you, Francesco