S > Selection (object)

Selection (object)

The Selection object allows you to set and control the currently focused editable text field. The currently focused editable text field is the field where the user's mouse pointer is currently placed. Selection-span indexes are zero-based (where the first position is 0, the second position is 1, and so on).

There is no constructor method for the Selection object, as there can only be one currently focused field at a time.


 
Method summary for the Selection object
Method Description

getBeginIndex

Returns the index at the beginning of selection span. Returns -1 if there is no index or currently selected field.

getCaretIndex

Returns the current caret position in the currently focused selection span. Returns -1 if there is no caret position or currently focused selection span.

getEndIndex

Returns the index at the end of the selection span. Returns -1 if there is no index or currently selected field.

getFocus

Returns the name of the variable for currently focused editable text field. Returns null if there is no currently focused editable text field.

setFocus

Focuses the editable text field associated with the variable specified in the argument.

setSelection

Sets the beginning and ending indexes of the selection span.