cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How can I add eventDelegate to a DatePicker control inside a fragment in a Dialog?

Akshai_Binuraj
Associate
Associate
0 Kudos
261

I have a Datepicker with id="lowDatePicker" inside a fragment in a dialog
In the controller, I am setting:

public onInit(): void {
const dateLowControl = this.byId("lowDatePicker");
if (dateLowControl) {
dateLowControl.addEventDelegate({
onAfterRendering: function (oEvent) {
console.log($("#" + dateLowControl.getId() + "-inner"));
$("#" + oEvent.srcControl.getId() + "-inner").prop("readonly", true);
},
});
}

But I am not getting the datePicker element. How to correctly add the eventDelegate in this case?

Accepted Solutions (0)

Answers (1)

Answers (1)

junwu
SAP Champion
SAP Champion
0 Kudos

depends on the scenario, you have to use different method to get the control

check the documentation

https://ui5.sap.com/#/topic/5da591c5a5a54740948acfe56b22fbc3