Set focus/cursor position on a field using double mouse click

Use this Forum to post your “How to …” questions about your use of aXes. This is not a technical support forum. Both the aXes Support Team at LANSA and other aXes customers may answer your questions. LANSA cannot guarantee the accuracy of any information posted by customers.

Moderator: jeanmichel

Post Reply
Eugene.King
Posts: 10
Joined: 09 Sep 2019, 19:26

Set focus/cursor position on a field using double mouse click

Post by Eugene.King » 23 Jul 2024, 18:16

In the DDS for an application the MOUSBTN key word has been used to enable mouse double clicking on a field on a 5250 screen. The F22 function key has also been assigned so that the user can use the function keys as well as the double mouse click. When F22/Double Click is used it acts as a kind of prompt on the field or can bring up additional information screens or go to specific details screens associated with that field. The fields can be input or output capable.

For the screen I've put this script in the 'On Arrive'

window.ondblclick = function(e){
console.log("double click event fired");
SENDKEY("F22");
};

This works, however I'm not picking up the field that I double clicked on so the cursor has not be set in the right position. How do I set the focus and cursor position for the field that I've double clicked on?

Eugene.King
Posts: 10
Joined: 09 Sep 2019, 19:26

Re: Set focus/cursor position on a field using double mouse click

Post by Eugene.King » 22 Aug 2024, 01:35

Thanks to the product team :D I now have a solution to the issue.

Firstly they advised to put the script in the 'onReady' event rather than the 'onArrive' event as the whole dom is loaded by the time this is triggered.

document.addEventListener('dblclick', function(event) { SENDKEY("F22"); });

This script works for input-capable fields but not for output fields which is what was required.
To enable this to work:

- navigate to the target screen and lock the screen for developer mode
- select the output field you want to modify
- click the pencil to edit the properties of the field's default visualization extension
- locate the AIDKeyOnDoubleClick property and replace the default 'Enter' with 'F22', or whatever key you want.
- Save the changes

You should now be able to double click on the field and send the appropriate key,
Attachments
aXesScreenShot.png
aXesScreenShot.png (139.29 KiB) Viewed 2834 times

Post Reply