Onclick response
-
- New User
- Posts: 4
- Joined: Tue Feb 27, 2018 11:46 am
- First Name: Renee
- Last Name: Taylor
- Company Name: Winsupply
- State / Province: Ohio
- Country: United States
- Contact:
Onclick response
I have an output field that when clicked, I want the application to think I pressed the F8 button. I have defined the onclick of the output field to pui.click("btnCF08"); and btnCF08 has a response defined of iQtys of type indicator. Ultimately, I need the click to call another RPG program that has a parameter defined. How do I get my program to recognize that iQtys should be on or directly call the RPG program onclick?
- Kaylee Law
- Profound Logic Staff Member
- Posts: 13
- Joined: Mon Sep 18, 2017 11:36 am
- First Name: Kaylee
- Last Name: Law
- Company Name: Profound Logic
- Contact:
Re: Onclick response
Thank you for writing in!
If your end goal is to call another RPG program, you can use the pui.run() API in the onclick event of your output field to call RPG programs. For example:
You can find more information on the pui.run() api here: http://www.profoundlogic.com/docs/pages ... Id=7864464
~Kyle
If your end goal is to call another RPG program, you can use the pui.run() API in the onclick event of your output field to call RPG programs. For example:
Code: Select all
pui.run({program:"LIBRARY/PROGRAM"});
~Kyle
Kaylee Law
Technical Support Specialist
Profound Logic Software
Technical Support Specialist
Profound Logic Software
-
- New User
- Posts: 4
- Joined: Tue Feb 27, 2018 11:46 am
- First Name: Renee
- Last Name: Taylor
- Company Name: Winsupply
- State / Province: Ohio
- Country: United States
- Contact:
Re: Onclick response
How do I specify a parameter with pui.run? I can't find an example and I'm not familiar with js.
- Kaylee Law
- Profound Logic Staff Member
- Posts: 13
- Joined: Mon Sep 18, 2017 11:36 am
- First Name: Kaylee
- Last Name: Law
- Company Name: Profound Logic
- Contact:
Re: Onclick response
To pass parameters with pui.run() you need to add a configuration option to add a javascript object that contains the parameters. For example:machine0318 wrote:How do I specify a parameter with pui.run? I can't find an example and I'm not familiar with js.
Code: Select all
pui.run({
program:"LIBRARY/PROGRAM",
params:{
p1:"parm1",
l1: 50,
p2:"parm2",
l2: 50,
p3:"parm3",
l3: 50
}
});
But after re-reading your original post, I am not sure this will be the solution you are looking for. When using pui.run() in Rich Display Applications, instead of control returning to the calling program after the called program ends, the session will end.
You mention that you have a button with id of "btnCF08" with a response bound to the feild iQtys which is defined as an indicator. In your RPG you can just use iQtys, like you would any other indicator, for example:
RPG CODE
Alternatively, we also have an API that simulates a button press.Code: Select all
pressKey("F8");
~Kyle
Kaylee Law
Technical Support Specialist
Profound Logic Software
Technical Support Specialist
Profound Logic Software
-
- 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: Onclick response
pui.run() is used to start a new Rich Display session that runs an anonymous program.
If you are simply trying to call another RPG program in the same session, you can do so the same way you did it in green-screen applications. Just use the standard RPG prototype with the EXTPGM keyword, or the old-fashioned CALL/PARM opcodes. There's no special logic needed for a Rich Display, just use a standard call like you've always done.
If you are simply trying to call another RPG program in the same session, you can do so the same way you did it in green-screen applications. Just use the standard RPG prototype with the EXTPGM keyword, or the old-fashioned CALL/PARM opcodes. There's no special logic needed for a Rich Display, just use a standard call like you've always done.
Who is online
Users browsing this forum: No registered users and 1 guest