top

SFTEXTINPUT

** This class will not be supported in 2015.

   All functionalities of sfTextInput class are more improved, integrating with CAPH. Therefore sfTextInput class is not supported since 2015 Smart TV. To use functions of sfTextInput class, refer to here.


This is the class for TextInput UI components.

Add the following line for sfTextInput class into a html file your own :

  script type="text/javascript" src="$MANAGER_WIDGET/Common/af/2.0.0/loader.js">/script>

You can declare sfTextInput class like this :

  ex) $('#div ID').sfTextInput('method Name', parm1, parm2);

       $('#div ID').sfTextInput({ Json type });


Methods

blur

Description
This function removes focus from the Input. Keypad will be hidden after this function is called.
Parameters
none
Return■Object
  - jQuery object
Emulator SupportN
SDK ConstraintNone
Example
$('#text1').sfTextInput('blur');

focus

Description
This function sets focus to the Input. Keypad will be shown after this function is called.
Parameters
none
Return■Object
  - jQuery object
Emulator SupportN
SDK ConstraintNone
Example
case sf.key.ENTER:
   var _THIS_ = this;
   $("#input_screen").css('visibility', 'visible');
   $("#input_button").sfButton('blur');
   $("#input1").sfTextInput({
    text: "INIT TEXT",
    maxlength: this.maxlength,
    ontextchanged: function (text) {
     _THIS_.handleTextChanged(text);
    },
    oncomplete: function (text) {
     _THIS_.handleComplete(text);
    },
    onkeypadchanged: function (keypadtype) {
     _THIS_.handleKeypadChanged(keypadtype);
    }
   }).sfTextInput('focus');
            break;

getKeypadType

Description
This function gets current keypad type (12key or qwerty).
Parameters
none
Return■String
  - 12 key or qwerty. If the IME object is not initialized, returns null.
Emulator SupportN
SDK ConstraintNone
Example
var keypad = $('#text1').sfTextInput('getKeypadType');

getText

Description
This function gets current text of Input.
Parameters
none
Return■String
  - Current text
Emulator SupportN
SDK ConstraintNone
Example
$("#textinput_result").html('Entered text: ' + makeBreakable($("#input1").sfTextInput('getText')));

ime

Description
This function calls the IME function of the input. Input creates IMEShell instance when it is created. This function calls the function of the instance (see the IME guide).
Parameters
■Any types
Return■Any Types
  - Returned value from IME object.
Emulator SupportN
SDK ConstraintNone
Example
var ime = $('#text1').sfTextInput('ime');

setKeypadPos

Description
This function sets keypad position.
Parameters
■left 
  - Number
  - Left position of the keypad. 
■top 
  - Number
  - Top position of the keypad.
Return■Object
  - jQuery object
Emulator SupportN
SDK ConstraintNone
Example
$("#input1").sfTextInput('setKeypadPos', offset.left+width, offset.top);