Re: Datepicker don't closes after picking same date GWT

2017-11-13 Thread Ameen Malhans
There is no error in browser console

-- 
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 google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Datepicker don't closes after picking same date GWT

2017-11-13 Thread Ameen Malhans
no errors in browser console


On Monday, November 13, 2017 at 12:24:43 PM UTC-5, Jens wrote:
>
> Any errors on the browser console?
>
> private native void attachInternal() /*-{ 
>   $wnd.jQuery("div.datePickerDay.datePickerDayIsValue").on( "Click", 
> function() {
> *this.*
> @com.xi.admin.client.common.ui.text.DateFormatter::uiDatePickerPopup.hide()();
> console.log("OK");
>   });
> }-*/;
>
> In your JSNI method "this" is probably not of type DateFormatter but the 
> div element that has been clicked on. Try
>
> private native void attachInternal() /*-{ 
>   var that = this;
>   $wnd.jQuery("div.datePickerDay.datePickerDayIsValue").on( "Click", 
> function() {
> 
> th...@com.xi.admin.client.common.ui.text.DateFormatter::uiDatePickerPopup.hide()();
> console.log("OK");
>   });
> }-*/;
>
>
> -- J.
>
>

-- 
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 google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Datepicker don't closes after picking same date GWT

2017-11-13 Thread Jens
Any errors on the browser console?

private native void attachInternal() /*-{ 
  $wnd.jQuery("div.datePickerDay.datePickerDayIsValue").on( "Click", 
function() {
*this.*
@com.xi.admin.client.common.ui.text.DateFormatter::uiDatePickerPopup.hide()();
console.log("OK");
  });
}-*/;

In your JSNI method "this" is probably not of type DateFormatter but the 
div element that has been clicked on. Try

private native void attachInternal() /*-{ 
  var that = this;
  $wnd.jQuery("div.datePickerDay.datePickerDayIsValue").on( "Click", 
function() {

th...@com.xi.admin.client.common.ui.text.DateFormatter::uiDatePickerPopup.hide()();
console.log("OK");
  });
}-*/;


-- J.

-- 
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 google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Datepicker don't closes after picking same date GWT

2017-11-13 Thread Thomas Broyer
Fwiw, I updated my StackOverflow 
answer: https://stackoverflow.com/a/47236713/116472

On Monday, November 13, 2017 at 6:04:42 PM UTC+1, Ameen Malhans wrote:
>
>
>
> down votefavorite 
> 
>
> 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() {
>
> th...@com.xi.admin.client.common.ui.text.DateFormatter::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() {
> @Override
> public void onValueChange(ValueChangeEvent 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 google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Datepicker don't closes after picking same date GWT

2017-11-13 Thread Ameen Malhans


down votefavorite 


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() {
   
th...@com.xi.admin.client.common.ui.text.DateFormatter::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() {
@Override
public void onValueChange(ValueChangeEvent 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 google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.