Can we call an RPG program from Javascript

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
rockman411
New User
Posts: 4
Joined: Fri Mar 16, 2012 5:03 am
First Name: Russell
Last Name: Crawford
Company Name: Cigna Healthcare
City: Glasgow
Country: United Kingdom
Contact:

Can we call an RPG program from Javascript

Post by rockman411 »

Is it possible to call an rpg program from JavaScript? Possibly using the POST command eg POST http://systemnam:port#/library/programname.pgm?

We are investigating calling an common RPG program from a link in the header.

Thanks in advance.

Russell Crawford (UK)
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: Can we call an RPG program from Javascript

Post by David »

If you want to call an RPGsp program directly from JavaScript (i.e. without submitting back to your RPG display file application and taking action from there), you'd need to do so with an Ajax call, and the RPG program would have to use CGI to read input from the Ajax call and to provide a response back to it.

Profound UI does include built-in JS APIs for making Ajax calls, see here:

http://www.profoundlogic.com/docs/displ ... evelopment

I'm wondering, though, if this is really what you want? What would the common program do or be used for? If you could explain a bit on what you are going for, I could advise on an approach.
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: Can we call an RPG program from Javascript

Post by Scott Klement »

Hi Russell,

Is this related to the discussion we had about the attention key?

I remember we were discussing perhaps creating a custom start.html that had a button in the header that would be displayed on all screens. Perhaps that's where you want to call an RPG program?

But, what would this program do? Would it bring up a PUI rich display (possibly in a new tab)? Or would it return information to be displayed in the header?

Thanks!
rockman411
New User
Posts: 4
Joined: Fri Mar 16, 2012 5:03 am
First Name: Russell
Last Name: Crawford
Company Name: Cigna Healthcare
City: Glasgow
Country: United Kingdom
Contact:

Re: Can we call an RPG program from Javascript

Post by rockman411 »

Thanks for your quick response to my query.

Scott: You're correct; this relates to the secondary menu problem that we are currently trying to decide how to make it work. We have previously been told that when the "Secondary Keyword Menu" link is pressed on our page header (see attached image), we can open a new tab and control the direction of the user's logon to our secondary menu using the Genie Macro Processing.

As an alternative to this design, could we just call an RPG program from this link which would open a new window of secondary keyword menu options (see second attached image). The window would overlay the screen the user is currently working on and allow the user to select another program.

My gut instinct tells me that this might not be feasible.


Thanks

Russell Crawford (UK)
Attachments
Secondary Menu Program
Secondary Menu Program
Secondary Menu Program.JPG (26.89 KiB) Viewed 2562 times
Secondary menu link on our page header
Secondary menu link on our page header
Secondary Menu Link.JPG (58.53 KiB) Viewed 2562 times
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: Can we call an RPG program from Javascript

Post by Scott Klement »

You could potentially do that, but there'd be some caveats:
  • You'd need to use browser authentication rather than PUI authentication (which may be fine with you?)
  • Assuming this is a PUI rich display program you're calling from the link in the header, it would replace the display you have open, which might not be ideal. This is why we suggested opening it in a separate tab, so both the main progam and the secondary menu could remain functioning at the same time. (This is also a more modern way of doing things -- allowing multitasking.)
  • All of the items on your secondary menu would need to be rich display programs. My understanding is that they weren't -- and this is why we suggested using Genie macros, instead.
Can you tell us a bit more about how the secondary menu works? Is it a rich display app? Or a 5250 app, as I thought before? Do you want it to really want it to open in the same tab/window and replace the existing session? Or, do you like my idea of creating a new tab?

Let us know, we'd be happy to discuss further and help any way we can.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests