setCursor( coordinates or id )
Sets the host cursor location. The host cursor is not the same as the browser's text cursor.
The browser's text cursor () and field focus are not affected by this function.
To set focus to a field in the browser, use the native JavaScript method, Object.focus().
Parameters
Set Cursor Position to Widget
widget id
– green-screen row and column to place the cursor in, or alternatively the id of the element to derive the row and column from
~
OR
~
Set Cursor Position to Coordinates
row
– green-screen row to place the host cursor.col
– green-screen column to place the host cursor.
Cursor Row and Cursor Column Properties of RDF Widgets
When used with Rich Display File (RDF) widgets, the cursor values are derived from the widget's 'cursor row' and 'cursor column' properties when an RDF widget id is passed. For converted screens, these properties are set to the original screen positions by the DDS Conversion tool.
Examples
Set Host Cursor Position to Row and Column
// Set host cursor position to coordinates (24,1). setCursor(24, 1); pressKey('F1');
Set Host Cursor Position to Row and Column of an Element
// Set host cursor position to coordinates of element "D_24_1". setCursor("D_24_1"); pressKey('F1');
Use focus() Method to Set Browser Focus
// Set browser focus to element "I_20_5" (place cursor in input field, i.e. textbox, or highlight input widget, i.e. radio button), instead of setting the host cursor directly. getObj("I_20_5").focus();