PDA

View Full Version : Validation icon stuck on DateField



jRon
14 Oct 2009, 3:32 AM
Hi,

I have a problem that the validation icon gets stuck on a
DateField even when a valid value is entered (but the css class,
x-form-invalid, is removed).

To reproduce the error follow these instructions in the submitted
example:

1. Load the GWT page
2. Select all text in the DateField after the month eg. "/14/09"
3. Hit delete
4. Tab out of the field

=> The field will be cleared and the validation icon
will be visible. But the field value is valid. If a correct
value is entered the validation icon will still be visible.

If the row
binding.bind(model); is comment out everything works fine.

GWT 1.7
GXT 2.0.2
Browser: IE 7, FF 3.0.8, Hosted Mode

I would appreciate if anyone could help me solve this.

Regards,
Jake



package gwt.client;

import java.util.Date;

import com.extjs.gxt.ui.client.binding.FieldBinding;
import com.extjs.gxt.ui.client.binding.FormBinding;
import com.extjs.gxt.ui.client.data.BaseModel;
import com.extjs.gxt.ui.client.widget.Viewport;
import com.extjs.gxt.ui.client.widget.form.DateField;
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;

public class DateFieldValidationError implements EntryPoint{
final private static String DATE_PROPERTY = "date";

private Viewport viewport;
private BaseModel model = new BaseModel();

public void onModuleLoad() {
viewport = new Viewport();

//Init model
model.set(DATE_PROPERTY, new Date());

//Create components
FormPanel formPanel = new FormPanel();
DateField date = new DateField();
date.setHideLabel(true);

//Bind to model
FormBinding binding = new FormBinding(formPanel);
binding.addFieldBinding(new FieldBinding(date, DATE_PROPERTY));
binding.bind(model);

formPanel.add(date);
viewport.add(formPanel);

RootPanel.get().add(viewport);
}
}

sven
15 Oct 2009, 10:56 AM
I tested this code against the latest SVN version and cannot reproduce this anymore. Can you confirm this?

jRon
16 Oct 2009, 3:07 AM
Yes I can confirm this!

I tested against revision 1749 in SVN and I couldn't reproduce it either.

Thanks!