down votefavorite 
<https://stackoverflow.com/questions/47230636/datepicker-dont-closes-after-picking-same-date-gwt/47236713#>

I am calling java from java-script to close the date picker pop Up using 
following method.


     private native void attachInternal() /*-{+      

    $wnd.jQuery("div.datePickerDay.datePickerDayIsValue").on( "Click", 
function() {
       
[email protected]::uiDatePickerPopup.hide()();

      console.log("OK");
    });
}-*/;


this method is again called in the method attached.

The problem is that date picker doesn't closes after selecting same date 
which is already selected, but on value change it closes.I want to close it 
even after selecting same date as earlier. The attach method is following

     public void attach() {

    attachInternal();

    datePickerValueChangeRegistration = uiDatePicker.addValueChangeHandler(new 
ValueChangeHandler<Date>() {
        @Override
        public void onValueChange(ValueChangeEvent<Date> event) {
            uiDatePickerPopup.hide();
            uiTextDate.setErrorVisible(false);
            
uiTextDate.setTextNoFormat(Moment.moment(event.getValue()).format("L"));
        }
    });

    textDateClickRegistration = uiTextDate.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            //if (uiTextDate.isReadOnly())
            //  return;
            if (!uiTextDate.isEnabled())
                return;
            showPopup();

        }
    });




-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to