SAP / openui5

OpenUI5 lets you build enterprise-ready web applications, responsive to all devices, running on almost any browser of your choice.
http://openui5.org
Apache License 2.0
2.95k stars 1.24k forks source link

sap.m.Select does not have 'press' or 'beforeOpen' event. #4115

Open lauge21kj98 opened 3 weeks ago

lauge21kj98 commented 3 weeks ago

Feature Request

OpenUI5 version: 1.127.0

https://sapui5.hana.ondemand.com/#/api/sap.m.Select

sap.m.Select does not have event 'press' or 'beforeOpen'.

If possible I would like to have a press or beforeOpen. This is customary for almost all you other controls, therefore I would greatly enjoy also having it on this control.

elenastoyanovaa commented 3 weeks ago

Hello @lauge21kj98 ,

Thank you for sharing your enhancement proposal. I've created an internal incident DINC0249608. The status of the issue will be updated here in GitHub.

Regards, Elena

plamenivanov91 commented 2 weeks ago

Hello @lauge21kj98 ,

You can attach your functionality to the public picker aggregation like this:

selectInstance.getPicker().attachBeforeOpen(function () {
    ...
})

You can read more about the before open event here: https://openui5.hana.ondemand.com/api/sap.m.Popover#events/beforeOpen

Is this good enough solution for you ?

Regards, Plamen Ivanov

lauge21kj98 commented 2 weeks ago

Yes thank you :)

boghyon commented 2 weeks ago

picker is currently an internal aggregation https://github.com/SAP/openui5/blob/1993bac5f40e3d70bf53c2174bb16e531472bf88/src/sap.m/src/sap/m/Select.js#L399-L406

flovogt commented 2 weeks ago

Thanks for pointing this out @boghyon.

@plamenivanov91 the mentioned code will cause errors if the application is written in TypeScript. So making this aggregation public would be an possible option

codeworrior commented 2 weeks ago

Please further note that the beforeOpen even is not consistent between the two possible implementations of picker, which can either be a sap.m.Dialog (beforeOpen will have no parameters) or a sap.m.Popover (beforeOpen will have an openBy parameter).

plamenivanov91 commented 1 week ago

Hello @lauge21kj98 ,

I have created internal backlog item BGSOFUIPIRIN-6661.

Once the feature is implemented this issue will be closed with link to the feature's change.

Regards, Plamen Ivanov