New Atrium Tab from RPG

Use this board to ask questions or have discussions with other Atrium users.
Post Reply
devinst
Profound User
Posts: 80
Joined: Mon Apr 20, 2009 11:26 am
First Name: Devin
Last Name: St. Germain
Company Name: Dupre Logistics, LLC
Phone: 337.314.2259
Address 1: 201 Energy Pkwy. Ste. 500
City: Lafayette
State / Province: Louisiana
Zip / Postal Code: 70508
Country: United States
Contact:

New Atrium Tab from RPG

Post by devinst »

Is there a way to open a new Atrium tab when calling a Rich Display program from a Rich Display program? I know the API exist for JS but not sure how to call it from RPG, if it is even possible.
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: New Atrium Tab from RPG

Post by Scott Klement »

Since Atrium runs in the browser, you need to call the API from the browser (i.e. from your screen.)

Starting a new Atrium tab will start a whole new job on IBM i... so it is very different from a CALL command in RPG. (More akin to a SBMJOB, I guess, except that its interactive of course.) If you wanted to do it from your RPG logic, one way would be to EXFMT a format, have that format launch the new Atrium tab, and once the tab is open, have the JavaScript press enter or click a button (pui.click() API) on the original format to send control back to RPG.
devinst
Profound User
Posts: 80
Joined: Mon Apr 20, 2009 11:26 am
First Name: Devin
Last Name: St. Germain
Company Name: Dupre Logistics, LLC
Phone: 337.314.2259
Address 1: 201 Energy Pkwy. Ste. 500
City: Lafayette
State / Province: Louisiana
Zip / Postal Code: 70508
Country: United States
Contact:

Re: New Atrium Tab from RPG

Post by devinst »

Thank you Scott.!!
I did think of doing it that way but was not immediately able to figure out a work around for the parameters that need to be sent. I have not used the parameter option in Atrium as of yet so I will look into that.
Thanks again for your help.!!
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: New Atrium Tab from RPG

Post by Scott Klement »

Assuming that you plan to use the Atrium.launchItem() API, there is a callback that runs when the tab has opened.
http://www.profoundlogic.com/docs/pages ... Id=7864724

So the idea is that when this callback has run, you know the tab has opened, and then you can use pui.click() to return control back to your RPG program.

Off the top of my head, the code might look like this:
<pre>
Atrium.launchItem(1234, true, function(success) {
if (success === true){
pui.click();
}
});
</pre>

Though, perhaps you want to remove the "if success" logic, so that control goes back to the RPG even if the tab couldn't be opened (for some unexpected reason)? Food for thought, I guess.
devinst
Profound User
Posts: 80
Joined: Mon Apr 20, 2009 11:26 am
First Name: Devin
Last Name: St. Germain
Company Name: Dupre Logistics, LLC
Phone: 337.314.2259
Address 1: 201 Energy Pkwy. Ste. 500
City: Lafayette
State / Province: Louisiana
Zip / Postal Code: 70508
Country: United States
Contact:

Re: New Atrium Tab from RPG

Post by devinst »

Sounds perfect. Thanks again Scott.!!
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests