Liquid UI - Documentation - 6.23 setcursor()

6.23 setcursor()


Purpose

With setcursor(), you can place the cursor into an inputfield, a table cell, or a position on the list of your choice. There are several possible syntaxes for the setcursor command, which are as follows:

 

Syntax

Description

setcursor([row,col]); To set the cursor into a field based on the coordinates.
setcursor("F[Name]"); To set the cursor into a specified inputfield.
setcursor("cell[tableName, col, row]"); To set the cursor into a table cell.

When you use setcursor on a table cell, the column can be identified either by the column number or by the column name as shown in the following examples:

 setcursor("cell[Data Entry Area, 5, 10]");
 setcursor("cell[Data Entry Area, Subobject, 4]");

Also, the row number can be specified by a variable as shown in the following example:

znum = 1;
setcursor("cell[Data Entry Area, 3, &V[z_num]]"); 

Note: When used with the table command, the column must always be listed before the row as shown in the previous example. Also, the setcursor command will only work for the first row if the table is empty.

 


Available Options

You can use the following options with the setcursor:

"offset":".."

"offset": X - Specifies the position of the cursor to place it from the left margin of the field.

Options Detail

offset

  1. The offset option of the setcursor command is used to place a cursor from the left margin of the field. You can use this option when there are multiple edit fields for an input field.

  2. setcursor("F[Payment card]",{"offset":20});
  3. As per the code, the cursor is positioned at the second field of "payment card", which is at position 20 from the left margin of the field.

Note: The offset option can only be used with a field name and doesn't work with field coordinates or on table cells.

 


Example

Using setcursor() command with Liquid UI fields

To set the cursor into a Liquid UI field, you can use either the field name or its coordinates, as shown below in the script. On execution, the cursor appears on the 'Price' item field, as shown in the following figure:

 


Script

setcursor("F[Price]"); 
or
setcursor("[1,1]"); 

Script Details


Usage Details


Can't find the answers you're looking for?