Skip to Content
avatar image
Former Member

how to set focus property on ui textfield in ui5

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Aug 07, 2013 at 12:53 PM
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 13, 2013 at 07:30 AM

    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

    Add comment
    10|10000 characters needed characters exceeded