What program is the current rich display based on?

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
jpmurtha
New User
Posts: 17
Joined: Thu Mar 12, 2015 6:33 pm
First Name: Jim
Last Name: Murtha
Company Name: Dealertrack
Contact:

What program is the current rich display based on?

Post by jpmurtha »

Dealertrack has javascript being called from pui.onload and pui.onsubmit in custom.js that needs to know if the current screen is the application menu driver program. I refer to this as the current program. Our application is essentially a single page web app. The initial screen (menu driver) displayed to the user allows them to choose which application functionality to run. After selecting a specific application function the browser tab text changes to display the screen header text so the user knows where they are at in the application by just looking at the browser tab or by moving the mouse over a tab. The requirement for loading text into the document.title changes when the application menu driver screen is the current screen/program.

Thus the reason to know how to access the name of the current program or display file. I have tried to figure out where the jason value for screen.file format name ends up in the generated html and have not been successful. Our app has no standard name for a label with the display file or program name. I was hopeful that the API currentFormatNames would define the current screen that would allow me to derive the current program, but I have not figured out the correct syntax for that (I have posted a seperate question for that).
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: What program is the current rich display based on?

Post by Scott Klement »

The pui.onload() routine is passed parameters that contain the library and display file name. This is documented here:
http://www.profoundlogic.com/docs/displ ... pui.onload

These routines are only called by Profound UI Rich DIsplays, so if you have written your own SPA (Single-Page App) rather than using our Rich Display environment, it will not call these routines... Unless you are explicitly calling them from your SPA?

If you are using Rich Displays, however, I would think the parameters passed to pui.onload could be used to set the document.title as you want it? I don't know of any way to get the actual program name (just the display file name) unless you want to pass the program name from your RPG code.
jpmurtha
New User
Posts: 17
Joined: Thu Mar 12, 2015 6:33 pm
First Name: Jim
Last Name: Murtha
Company Name: Dealertrack
Contact:

Re: What program is the current rich display based on?

Post by jpmurtha »

The answer to the question regarding which RPG program is displaying the current screen can be answered by determining which current format name(s) are being displayed. This is a property of the pui object. So the syntax to retrieve the javascript array is simply pui.currentFormatNames.

Here is an example of the result of calling pui.currentFormatNames from the Chrome developer tools console. Typing in the object.property name will return a javascript array. In the example below the pui object property currentFormatNames is 'SE1000DE'. So the current program is the one that displays this format. Note: please note that the pui property is a javascript array.

Code: Select all

pui.currentFormatNames
["SE1000DE"]
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest