Highlighted
New Member.
520 views

JS function to set the cursor focus to a structure array field.

does any one know of JS function to set the cursor focus to a field?

0 Likes
2 Replies
Highlighted
New Member.

Re: JS function to set the cursor focus to a structure array field.

I'm using the below statement and it's not working;

system.functions.cursor_field_name_set("vars.$file.update_type");

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: JS function to set the cursor focus to a structure array field.

the field name should literally match what you have specified as the input for the widget you want to recieve the focus.

For example if I added a text widget to the format "ScriptLibrary' with an input of $f.x then went to the SriptLibrary and created a new entry called testit with this content:

system.functions.cursor_field_name_set("$f.x");

when I Add, Compile then Execute the focus should jump to the new input field we just added.

You do not need the 'vars.' prefi since even though you are in JS, the value you are using is a literal in double quotes so you do not need to use the 'vars.' prefix.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.