cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to get Jquery event from SAP UI5 event?

former_member602416
Participant
0 Kudos

Hi,

I am trying to get JQuery event dispatched on click of a button inside my controller. I need jquery event to get to know the type of event(in case of button its 'tap') . I debugged standard code for button and from call stack i can see in UIArea-dbg.js file it is a tap event which later converts into Press event in Button-dbg.js file inside Button.prototype.ontap function.

EventProvider.dbg.js file has 'EventProvider.prototype.fireEvent' function and inside the function it calls listener function by checking mEventRegistry. Once it is inside the called function it is not possible to know what was the original type of event.

Based on my investigation below is the flow of event -

Native event -> Jquery event -> only srcControl node of Jquery event passed to EventProvider-dbg.js fireEvent method -> fireEvent calls listener function from mEventRegistry

I am sure it should be possible to get event type from SAP UI5 event but dont know how. Can someone please advice?

P.S. - I have use button control to explain my issue but i need to capture event type for any user interaction happen on the screen with any sap ui control.

WouterLemaire
Active Contributor
0 Kudos

Why do you need to jquery event? Be careful with relaying on jquery stuff, UI5 is moving it out of the framework...

former_member602416
Participant
0 Kudos

Thanks for highlighting. As i mentioned I need browser event type for the triggered event. In SAP UI5 a control element can have multiple eventRegistry for example a button mEventRegistry has two events 'press and '_change'. But when a button is pressed it dispatch tap event which eventually changed to press event and later _change event also get trigger. If i see logic in Button-dgb.js file then tap gets changed to press. So browser event tap is linked to UI5 event press but not to _change.

So my requirement is to when i see both events press and _change, how to find out which one is linked to browser event. I can't explain why I need this because then I have to explain my whole project itself.

Similarly for sap.m.Input it has eventRegistry of below events -

change, initialise, innerControlsCreated, visibleChanged and _change. Only change event is linked to browser event but other events also get triggered.

Hope I have managed to explain my requirement.

Accepted Solutions (0)

Answers (0)