Looks like we cannot reproduce this. Please provide another test case to reproduce this issue.
-
Ext GWT Premium Member
DateField doesn't fire CHANGE event when using date picker
Hi,
I think i found a bug in DateField. I noticed that "Change" event is not fired when date is selected using calendar/date picker widget. Could you please let me know if it is expected behaviour and i should handle some other event or that is an error.
Kuba
-
The change event only fires when you blur the field. This is in common with the default browser change event. Also all other fields behave like this. We maybe can add another event to fit your needs. We already did the same for combobox.
I will move this thread to the bugs forum.
-
Ext GWT Premium Member
That is right but ChangeEvent is not fired onblur as well. When you select date using datePicker then FieldDate gets focus and then when you click outside (blur) the field ChangeEvent is not fired. I know this happens because native events are not fired when change is result of java script action but it would be great to modify that behaviour.
-
Thanks for clarifiying. We will update the thread once we have a solution ready.
-
Sencha User
I was in the process of trying to figure out why DateField validation didn't work anymore. I guess this thread solves that.
At any rate, I think it did work with
Code:
dateFrom.addValueChangeHandler(new ValueChangeHandler<Date>() {
@Override
public void onValueChange(ValueChangeEvent<Date> event) {
...
}
});
in earlier development versions. But I can be mistaken.
I can trigger the event by changing the focus to a second DateField.
-
Sencha User
I do not believe this bug was fixed in 3.0.1. Looking at:
http://www.sencha.com/examples/#Exam...e:formsexample
The birthday field fires the value change event where it should including when using the date picker.
Is anyone still seeing this issue?
-
Sencha User
I had the same issue. I changed my code to
Code:
dateField.getDatePicker().addValueChangeHandler()
and it works.
-
Sencha Premium Member
Okay, i think everything is working normal. The ValueChangeEvent only fires if you blur the datefield.
If you directly want to recognize a value change then take the solution of suganya08 as a workaround.
But i think there is missing a SelectionHandler like it is in a ComboBox. There you directly recognize if you select an item and the selectionchanged. I think a ChangeHandler or a SelectionHandler should be added to DateField. So if you pick a date then the value changed and you don't have to blur the field first.
-
Sencha - Support Team
So far I see this is not re-produceable.
Just walking the thread to check to see if there help is still needed to solve this issue? If not I'll close the bug request.
Please reply with a test standalone test case if the issue is still an issue, and we will look again.
-
14 Jul 2014, 10:59 PM
#10
Sencha Premium Member
So, like i said in my previous post, there isn't a bug at all. There is only a missing feature. I will try to explain it again.
The datefield has a datepicker in its class which listen to the valuechangeevent. So you can exactly recognize a value change. If you add a valuechangelistener for the datefield the valuechangeevent is only called if you blur the field. So it's the normal behaviour for all fields. This is OK!
But every field like the ComboBox has a selectionEvent where you directly recognize the change of a value BEFORE you blur the field. This isn' t the case in a datefield. You have to blur it first or add the valuechangelistener to the datepicker of the datefield. I think there is missing a selectionhandler for the datefield where you listen to selection events and immediately get the selected date.
You have to implement HasBeforeSelectionHandlers, HasSelectionHandlers for datefield.