Required Information

Version(s) of Ext GWT
EXT GWT 3.0.0b

Browser versions and OS
(and desktop environment, if applicable)
  • Internet Explorer 8, Windows XP Professional


Virtual Machine
No

Description
If I have a GridInlineEditing-Object, which is wrapping an UIObject in a grid, I encounter the following bugpattern:
For instance I have a TextField which is required and autovalidate is set true and I click into the field, delete the input, I get an errormessage, which is right in my eyes. But if I click into another cell in the same row with a valid value in the field I get an error ("This fiels is required"), despite the fact that, the required fielddata is in place.
Run mode
Development mode

Steps to reproduce the problem
  1. </i>
  2. Start running in development mode in Eclipse
  3. Open app in browser
  4. Click a cell in the 2nd column in the grid
  5. Delete the input
  6. Click into the cell right under (same column)


Expected result
I would expect, that the later clicked cell isn't marked as invalid.
Actual result
The later clicked cell is marked invalid
Test case
Code:
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat;
import com.google.gwt.user.client.ui.RootPanel;
import com.sencha.gxt.core.client.ValueProvider;
import com.sencha.gxt.data.shared.ListStore;
import com.sencha.gxt.data.shared.ModelKeyProvider;
import com.sencha.gxt.data.shared.PropertyAccess;
import com.sencha.gxt.widget.core.client.ContentPanel;
import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer;
import com.sencha.gxt.widget.core.client.form.DateField;
import com.sencha.gxt.widget.core.client.form.DateTimePropertyEditor;
import com.sencha.gxt.widget.core.client.form.TextField;
import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
import com.sencha.gxt.widget.core.client.grid.ColumnModel;
import com.sencha.gxt.widget.core.client.grid.Grid;
import com.sencha.gxt.widget.core.client.grid.editing.GridInlineEditing;

public class TestGridColumnScreen implements EntryPoint {

	class TestData {
		Integer id;
		Date date;
		String desc;
		
		
		
		public TestData(Integer id, Date date, String desc) {
			super();
			this.id = id;
			this.date = date;
			this.desc = desc;
		}
		
		public Integer getId() {
			return id;
		}
		public void setId(Integer id) {
			this.id = id;
		}
		public Date getDate() {
			return date;
		}
		public void setDate(Date date) {
			this.date = date;
		}

		public String getDesc() {
			return desc;
		}

		public void setDesc(String desc) {
			this.desc = desc;
		}
	}

	interface TestDataProperties extends PropertyAccess<TestData> {
		ModelKeyProvider<TestData> id();
		ValueProvider<TestData, Date> date();
		ValueProvider<TestData, String> desc();
	}

	private static final TestDataProperties properties = GWT.create(TestDataProperties.class);

	protected Grid<TestData> grid;

	private ContentPanel panel;

	public TestGridColumnScreen() {
		panel = new ContentPanel();
	}

	

	public void onModuleLoad() { 

		HorizontalLayoutContainer container = new HorizontalLayoutContainer();
		panel.add(container);
		panel.setPixelSize(800, 600);
		
		ColumnConfig<TestData, Date> date = new ColumnConfig<TestData, Date>(properties.date(), 95, "Date");
		ColumnConfig<TestData, String> desc = new ColumnConfig<TestData, String>(properties.desc(), 95, "desc");
		List<ColumnConfig<TestData, ?>> l = new ArrayList<ColumnConfig<TestData, ?>>();
		l.add(date);
		l.add(desc);
		
		ColumnModel<TestData> columnModel = new ColumnModel<TestData>(l);

		final ListStore<TestData> store = new ListStore<TestData>(properties.id());
		store.addAll(getTestData());

		grid = new Grid<TestData>(store, columnModel);
		
		final GridInlineEditing<TestData> editing = new GridInlineEditing<TestData>(grid);
		DateField dateField = new DateField(new DateTimePropertyEditor(DateTimeFormat.getFormat(PredefinedFormat.DATE_SHORT)));
		dateField.setAllowBlank(false);
		dateField.setAutoValidate(true);
		editing.addEditor(date, dateField);

		TextField textField = new TextField();
		textField.setAllowBlank(false);
		textField.setAutoValidate(true);
		editing.addEditor(desc, textField);
		
		container.add(grid);
		RootPanel.get().add(panel);
	}

	private Collection<TestData> getTestData() {
		List<TestData> testData = new ArrayList<TestData>();
		for (int i = 0; i < 10; i++) {
			testData.add(new TestData( i, new Date(), "" + i));
		}
		return testData;
	}
}
Helpful Information

Screenshot or video


Live test
Debugging already done


Possible fix