Page 1 of 1

Genie Macro from Javascript

Posted: Fri Aug 28, 2020 1:50 pm
by pjshuey
I have an RPG program that I am converting the screen to a rich display. The program is a grid that the users can select actions on the row like work with spool files, work with job, etc. via qcmdexc calls. I have these commands set up as genie macros that can be called from Atrium, but can they be called from and RPG program or javascript on the screen within Atrium? Or is there another, easier way to do this?

Re: Genie Macro from Javascript

Posted: Fri Aug 28, 2020 1:53 pm
by Scott Klement
If you create an XML-based macro, you can launch it from the URL.
https://docs.profoundlogic.com/display/PUI/Macros

Re: Genie Macro from Javascript

Posted: Mon Aug 31, 2020 1:00 pm
by pjshuey
I got this to work, but is there a way to have it open in a new Atrium tab instead of a new browser tab?

Re: Genie Macro from Javascript

Posted: Mon Aug 31, 2020 2:45 pm
by Scott Klement
It's not clear how you are launching the URL. If its from an Atrium item, you could configure it like this:
atriumXmlMacro.png
atriumXmlMacro.png (11.64 KiB) Viewed 1657 times

Re: Genie Macro from Javascript

Posted: Mon Aug 31, 2020 3:01 pm
by pjshuey
I need to launch it from a program. It is actually a drop down selection from a grid. To test it, I put a button on my screen with the following in the onclick property:

window.open("http://10.10.2.4:8082/profoundui/auth/g ... ue1=WRKMSG");

Please note this genie macro was just for me to test the theory. I will have to build the parameters for the macro on the fly in my "real" program.

This works great, but it opens in a new browser window. I'd like to keep it in the atrium window as a new tab.

Re: Genie Macro from Javascript

Posted: Mon Aug 31, 2020 4:00 pm
by Scott Klement
Thanks for the clarification.

window.open() will open a new browser window or tab -- that's what it does.

In order to open an Atrium tab, remove the window.open() and use Atrium.launchURL() instead.
https://docs.profoundlogic.com/pages/vi ... Id=7864719

Re: Genie Macro from Javascript

Posted: Tue Sep 01, 2020 11:37 am
by pjshuey
Thanks so much Scott! This is working great!