Looks like we cannot reproduce this. Please provide another test case to reproduce this issue.
  1. #1
    Ext GWT Premium Member
    Join Date
    Apr 2012
    Location
    Warsaw, Poland
    Posts
    22
    Vote Rating
    0
    jsciuba is on a distinguished road

      0  

    Default DateField doesn't fire CHANGE event when using date picker

    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

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    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.

  3. #3
    Ext GWT Premium Member
    Join Date
    Apr 2012
    Location
    Warsaw, Poland
    Posts
    22
    Vote Rating
    0
    jsciuba is on a distinguished road

      0  

    Default


    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.

  4. #4
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Thanks for clarifiying. We will update the thread once we have a solution ready.

  5. #5
    Sencha User dannmartens's Avatar
    Join Date
    Aug 2010
    Posts
    13
    Vote Rating
    0
    dannmartens is on a distinguished road

      0  

    Default


    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.

  6. #6
    Sencha - GXT Dev Team darrellmeyer's Avatar
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,242
    Vote Rating
    2
    darrellmeyer is on a distinguished road

      0  

    Default


    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?

  7. #7
    Sencha User
    Join Date
    Sep 2010
    Posts
    15
    Vote Rating
    0
    suganya08 is on a distinguished road

      0  

    Default


    I had the same issue. I changed my code to
    Code:
    dateField.getDatePicker().addValueChangeHandler()
    and it works.

  8. #8
    Sencha Premium Member feelinforyou's Avatar
    Join Date
    Dec 2012
    Posts
    94
    Vote Rating
    4
    feelinforyou is on a distinguished road

      0  

    Default


    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.

  9. #9
    Sencha - GXT Dev Team
    Join Date
    Jan 2012
    Location
    Arlington, WA
    Posts
    402
    Vote Rating
    15
    branflake2267 will become famous soon enough

      0  

    Default


    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.
    Thanks,
    Brandon
    GXT Support

    ~ New GXT Guides ~
    http://docs.sencha.com/gxt/3.1/

    ~ Support Tickets ~
    https://support.sencha.com/index.php

    ~ Tips and Announcements Community ~
    https://plus.google.com/communities/110447085143928405373

    ~Training~
    Get on the Fast Track with Sencha Training http://sencha.com/training

  10. #10
    Sencha Premium Member feelinforyou's Avatar
    Join Date
    Dec 2012
    Posts
    94
    Vote Rating
    4
    feelinforyou is on a distinguished road

      0  

    Default


    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.