0
我從Java調用腳本的Java關閉日期選擇器彈出使用以下方法後,沒有關閉。日期選擇器選擇做同日GWT
private native void attachInternal() /*-{+
$wnd.jQuery("div.datePickerDay.datePickerDayIsValue").on("Click", function() {
[email protected]::uiDatePickerPopup.hide();
console.log("OK");
});
}-*/;
該方法在所附方法中再次被調用。
的問題是,日期選擇器中選擇其已被選中同一日期後不關閉,但在價值變動它closes.I想即使選擇相同的日期更早之後將其關閉。 的連接方法如下
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();
}
});
我明白了你說的話。但在此之後仍然不work.it不調用該方法 – Ameen
哈!這''這可能不是你認爲的那樣!更新了我的答案。 –
沒有它不工作out.I我無法找出原因。 – Ameen