Genie Macro from Javascript

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
pjshuey
Experienced User
Posts: 119
Joined: Wed May 25, 2016 11:58 am
First Name: Patti
Last Name: Shuey
Company Name: Conestoga Wood Specialties
Phone: 7174452886
Address 1: 645 Reading Road
City: East Earl
State / Province: Pennsylvania
Zip / Postal Code: 17519
Country: United States
Contact:

Genie Macro from Javascript

Post 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?
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Genie Macro from Javascript

Post by Scott Klement »

If you create an XML-based macro, you can launch it from the URL.
https://docs.profoundlogic.com/display/PUI/Macros
pjshuey
Experienced User
Posts: 119
Joined: Wed May 25, 2016 11:58 am
First Name: Patti
Last Name: Shuey
Company Name: Conestoga Wood Specialties
Phone: 7174452886
Address 1: 645 Reading Road
City: East Earl
State / Province: Pennsylvania
Zip / Postal Code: 17519
Country: United States
Contact:

Re: Genie Macro from Javascript

Post 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?
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Genie Macro from Javascript

Post 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 1651 times
pjshuey
Experienced User
Posts: 119
Joined: Wed May 25, 2016 11:58 am
First Name: Patti
Last Name: Shuey
Company Name: Conestoga Wood Specialties
Phone: 7174452886
Address 1: 645 Reading Road
City: East Earl
State / Province: Pennsylvania
Zip / Postal Code: 17519
Country: United States
Contact:

Re: Genie Macro from Javascript

Post 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.
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Genie Macro from Javascript

Post 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
pjshuey
Experienced User
Posts: 119
Joined: Wed May 25, 2016 11:58 am
First Name: Patti
Last Name: Shuey
Company Name: Conestoga Wood Specialties
Phone: 7174452886
Address 1: 645 Reading Road
City: East Earl
State / Province: Pennsylvania
Zip / Postal Code: 17519
Country: United States
Contact:

Re: Genie Macro from Javascript

Post by pjshuey »

Thanks so much Scott! This is working great!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest