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