Results 1 to 3 of 3
  1.    #1  
    hi...

    I'm having problems with the focus on the textfield. My application has a button "erase", which erases the textfield contents. I wish the focus back to the textfield after using the button.

    My code:

    setup:
    Code:
    this.controller.setupWidget( "txtArea", {
    	textFieldName: 'notes',
    	hintText: 'Enter a Note',
    	modelProperty: 'value',
    	multiline: true,
    	limitResize: true,
    	enterSubmits : true
    }, this.textModel = {value : ""};
    function:
    Code:
    TextAssistant.prototype.clearText = function(event){
    	this.controller.get("txtArea").innerHTML = null;
    }
    
    TextAssistant.prototype.encodeValue = function(val) {
    	return val.replace(/>/g,"&gt;").replace(/</g,"&lt;");
    }
  2. #2  
    Try the focus method. Perhaps something like this at the end of your button handler:
    Code:
    this.controller.get("txtArea").mojo.focus();
  3.    #3  
    Quote Originally Posted by zelmo View Post
    Try the focus method. Perhaps something like this at the end of your button handler:
    Code:
    this.controller.get("txtArea").mojo.focus();

    I trie use this method but doesnt works!

    My button is in commandMenu, and set this method in handleCommand

Posting Permissions