Hybrid View
-
8 Nov 2008 6:52 AM #1
[CLOSED] GXT 1.1.2: DateField does not fire Change Event
[CLOSED] GXT 1.1.2: DateField does not fire Change Event
I am finding that DateField objects do not seem to fire change events when they are updated. I am trying to use change listeners to keep field values in sync with model values in a uniform way, but DateFields don't seem to want to cooperate.
Here is a simple example.
FormPanel fp = new FormPanel();
final DateField df = new DateField();
df.addListener(Events.Change, new Listener() {
public void handleEvent(FieldEvent p_event)
{
MessageBox.alert("Date Field Changed", df.getValue(), null);
}
});
The change event never fires when I render this guy. In addition, I have tried firing the change event myself from the setValue() method, but that seems to wreak havoc with the widget a bit. Not sure why, but I am looking at the internals now.
-
10 Nov 2008 8:53 AM #2
Please post complete test code when submitting a bug as it make it much easier to replicate the issue.
For example:
The change events fires when the field is blurred, not when the user selects a value from the date picker. I did find a bug. In some browsers, if you did not put focus on the text field before clicking the trigger the change event did not fire. This is fixed in SVN.Code:public void onModuleLoad() { FormPanel fp = new FormPanel(); DateField df = new DateField(); df.addListener(Events.Change, new Listener<FieldEvent>() { public void handleEvent(FieldEvent p_event) { Window.alert("change: " + p_event.value); } }); fp.add(df); RootPanel.get().add(fp); }
-
12 Nov 2008 5:33 AM #3
Code Examples will do...
Code Examples will do...
Darrell -
No problem on the code examples. Thanks a ton for getting those fixes in. This one and the resize issue fixed me right up. Much appreciated.
-
10 Mar 2010 5:56 PM #4
but what about if you want the event to fire on change (that is once user has clicked a date on the datepicker) and you DO NOT want to have to wait for blur to occur ????
-
22 Apr 2010 6:20 AM #5
There is a solution :
Code:DateField startDate = new DateField(); startDate.getDatePicker().addListener(Events.Select, new Listener<DatePickerEvent>() { public void handleEvent(DatePickerEvent be) { // TODO Auto-generated method stub //On Select event :) } });
-
23 Aug 2011 3:38 AM #6
Is it possible to auto-blur the DateField when the picker fires a selected event?
Is it possible to auto-blur the DateField when the picker fires a selected event?
Is it possible to auto-blur the DateField when the picker fires a selected event?
I can only find a way to focus another field, but it would be best if the field could be de-focused automatically.
This would allow the change event to fire, and also stop users accidentally typing in the field once they have selected a date.


Reply With Quote