Notifications

4 views

Issue

Description

When a catalog item / record producer loads by default the focus will always be on the first variable per the system property "glide.ui.focus_first_element" (set to true).

This article will detain the steps that can be taken to make the focus be of any variable of choice on the form.

Procedure

1) Open the catalog item / record producer in question

2) Go to the related list "Catalog Client Scripts" and click New

3) Fill out the fields as necessary and make sure that Type is onLoad. 

4) On the script field paste the following code:

setTimeout(function(){
g_form.getElement('name_of_variable').focus();
}, 0);

 

*Replace 'name_of_variable' parameter with the actual name of the variable

5) Note that the above code is valid for non-reference type variables only. For reference type variables use the following code:

setTimeout(function(){
g_form.getElement('var_two').parentElement.lastElementChild.firstChild.focus();
}, 0);

6) Now load the catalog item / record producer again and the focus should be on the target variable

Applicable Versions

London and beyond

Additional Information

For normal fields on the table forms visit the following documentation for similar solution:

Modify form focus

Article Information

Last Updated:2019-08-02 20:36:09
Published:2019-07-26