Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

sap.m.Input - How to catch onFocus-Event


i am new at sapui5 and i try to create my first mobile app.

Is there any way to catch the onfocus-event on an sap.m.Input-element?

Can´t find any method to do this in API-DOC and Google told me to create a custom-component?!?!?!?


In Chrome inspector my Input-element looks like this:

<div id="id_text" data-sap-ui="id_text" style="width:100%" class="sapMInput sapMInputBase sapMInputBaseCursor">

     <input id="id_text-inner" value="TEST_VALUE" type="text" class="sapMInputBaseInner">


Maybe there is a smart way to add the onfocus eventhandler to the "id-inner" inputfield?

Some ideas?

Thank you


Former Member
Former Member replied

You can attach to native and SAP-specific events using the addEventDelegate method of any control. Here's an example:,js,output

- Max

1 View this answer in context

Helpful Answer

Not what you were looking for? View more on this topic or Ask a question