AutoGUI+ Menu Items

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
LuisSantana
Posts: 5
Joined: 25 Jul 2017, 01:16

AutoGUI+ Menu Items

Post by LuisSantana »

Hi All,
I have a customer that has reported the following situatoin he needs help with:

"I have a bunch of menu programs and is there way to get the AutoGui to automatically trim the blank spaces on the values? Example when you click on the link the auto gui puts in ‘ 1’ instead of ‘1’. Reason is, half my menu options on numerous screens are entered in that way which means half my menu links don’t work."

I can't figure out how to solve this problem. I've tried editing the regular expression in the AutoGUI+ rules that build the menu items, but I can't figure out the correct syntax. Here is the shipped value: ^( *\d+)\.(?!\d+)(.*)$

I'm hoping to find any global solution that doesn't require me to go to each affected screen and make the change.

Any help would be appreciated.

Thanks, Luis
User avatar
Dino
Posts: 88
Joined: 19 May 2017, 08:29

Re: AutoGUI+ Menu Items

Post by Dino »

Hi

If the menu item have an space, like " 1." instead of "1." , that expression in the Identification Rules should capture it and recognize it as a menu item, displaying it with the menu item image.

The problem then could be handled when it returns the menu value to the command line, which you can change in
AutoGUI Menu Item / properties / extension / value , you change it to script and place the following script there:

Code: Select all

var valueText = FIELD.getValue().trim().replace(" ","");
ENV.returnValue = parseInt(valueText);
menuitem.jpg
menuitem.jpg (180.2 KiB) Viewed 5907 times
LuisSantana
Posts: 5
Joined: 25 Jul 2017, 01:16

Re: AutoGUI+ Menu Items

Post by LuisSantana »

Thank you very much. This might offer a good global solution. I can't test it on our system, since I don't have screens that behave like the cusotmers, but at least I have something to work with. I did notice that after I apply your change, some of the menu items on some of my screens were misaligned. See screenshot. Any idea if I can correct that globally as well? If not, I'll just tell the customer they need to manually change some screens. Thanks again.
Here is what my LANSA Main System Menu Now Looks Like
Here is what my LANSA Main System Menu Now Looks Like
LANSAMainSystemMenu.JPG (51.75 KiB) Viewed 5904 times
Fairdinkum
Posts: 128
Joined: 24 Jul 2017, 17:02

Re: AutoGUI+ Menu Items

Post by Fairdinkum »

Hi Luis,

I encountered a similar problem, and solved it with the attached auto-gui rule. I'm not 100% sure if your problem is the same as mine, though, you can try this in your test environment when you have time. Just importing the attached .json file.
Image 2186.png
Image 2186.png (143.81 KiB) Viewed 5869 times

Code: Select all

var menuNum = FIELD.getValue().split(".")[0].trim();
ENV.returnValue = Number( menuNum );
Hope this helps!

Regards,
Hide from Fairdinkum
Attachments
axautoguirules(trimMenuNumbers).zip
(627 Bytes) Downloaded 495 times
Post Reply