Skip to Content
avatar image
Former Member

Defining focus on sub control for custom control

I am currently developing a custom control which has a div and within it contains a input on the left and a button on the right. What I would like to know is how can I do it such that when the label for the control is click, it will focus on the input and not on the div of the custom control?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jan 25 at 10:06 PM

    Hi,

    I don't have your code so there are some unknowns here, but if you can attach a press event to this "custom div" then have it point to this function (I'm assuming the Label has an id attribute of "myLabel", i.e. <Label id="myLabel" ... ):

    onFocus: function(){
      this.getView().byId("myLabel").focus();	
    }
    
    Add comment
    10|10000 characters needed characters exceeded