cancel
Showing results for 
Search instead for 
Did you mean: 

how to set focus property on ui textfield in ui5

Former Member
0 Kudos

hi experts....

tell  me how to set focus on ui textfield in ui5..

currently i am using change property  of textfield that work after changing the content of textfield.....but i want to call a function on focus...that is done by onfocus method by java script....but how in ui5 textfield

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Sumit,

There doesn't seem to be a focus event for the TextField control (atleast going by the documentation), so it is probably not exposed by the framework.

As a workaround, you could try this jQuery snippet :

$("#" + id).on("focus", function() {

     .. your focus handler code..

     ..

     ..

}

And replace "id" with the ID of the TextField you're using. Also note, that this snippet should be executed only AFTER the TextField has been rendered on the screen.

Regards,

Pritin

ChandraMahajan
Active Contributor
0 Kudos