'How do I hide the Calendar Popover on a SAPUI5 DatePicker?
I'm using a sap.m.DatePicker which instantiates a ResponsivePopover, including a Calendar and two buttons (Today and Next Day) on the navigate event.
<DatePicker
navigate="onNavigate"
>
onNavigate: function (oEvent) {
var oRespPopover = new sap.m.ResponsivePopover({
class: "adam2",
showHeader: false,
content: [
new sap.ui.unified.Calendar({
select: oEvent => {
oRespPopover.close();
this.onRequestedDeliveryDateChange(oEvent,false,false);
}
})
],
beginButton: new sap.m.Button({
text: "Today",
press: function (oEvent) {
oRespPopover.close();
this.onRequestedDeliveryDateChange(false,true,false);
}
}),
endButton: new sap.m.Button({
text: "Next Day",
press: function (oEvent) {
oRespPopover.close();
this.onRequestedDeliveryDateChange(false,false,true);
}
}),
afterClose: function (oEvent) {
oRespPopover.destroy();
this.onHeaderInputChange();
this.saveFieldsToSession();
}
});
oRespPopover.openBy(oEvent.getSource());
},
... Which displays the ResponsivePopover as shown below, with a Calendar and two custom buttons.
The issue I have is, when clicking on the DatePicker, it opens my new ResponsivePopover, but the standard DatePicker Calendar popover flashes up momentarily. beforehand.
So my question is, how do I hide the Calendar Popover on a DatePicker so that it doesn't flash up when I execute it's navigate event?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

