Is this in a Genie screen or a Profound UI screen? What are you trying to do with this API? If you could provide us with more details on what you are trying to accomplish that would be helpful.
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 also as the current program. Our application is essentially a single page web app. The initial screen (application menu driver) allows users to navigate application functionality. 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.
I can solve this issue by adding a unique hidden field name to the screen formats I want to detect or by assigning a specific css class. But if I can learn to accomplish what I want via an API I believe I will have a better approach that will work better in similar but different situations.
I have decided to determine whether the current screen is the application menu by including a hidden field on the applicable formats. In the pui.onload function call from custom.js I can look for this object from javascript to determine the state of the program.
I still think it would be helpful to have an API that can retrieve the screen format screen name(s) currently being displayed. But for now, I will use the work around above.
Glad to hear you have a workaround in the meantime. What version of Profound UI are you currently using? Its possible the API is not available in the current version you are on. I will have to double check when this API was made available.
The API is named currentFormatNames() (not pui.currentFormatNames). It requires Profound UI 5.0.5, and it is a function that you call, not a variable. It can only tell you the format names in a Rich Display, it will not work on a 5250 screen.
For example, if you wanted to pop up an alert box telling you the names of each format (including overlaid formats) you would code it like this:
Scott Klement wrote:The API is named currentFormatNames() (not pui.currentFormatNames). It requires Profound UI 5.0.5, and it is a function that you call, not a variable. It can only tell you the format names in a Rich Display, it will not work on a 5250 screen.
For example, if you wanted to pop up an alert box telling you the names of each format (including overlaid formats) you would code it like this:
Hmmm... that's an excellent question, Tony... Looking at the code, it does not appear that pui.currentFormatNames (which is an array) is meant to be available to customers.
We have a process of "obfuscating"' our source code, which makes it smaller and use less memory. Normally code that isn't available to customers is obfuscated, preventing customers from using it. From looking at the code, the pui.currentFormatNames array is meant to be obfuscated, customers don't need it, they should be calling the currentFormatNames() API instead.
However, you're right, the pui.currentFormatNames array isn't obfuscated when all is said and done. I don't know why that is -- I'm guessing that because 'currentFormatNames' is not obfuscated, the Closure software (that we use for obfuscating) is also not obfuscating pui.currentFormatNames... That's something I would not expect, but it appears to be what's happening... But, that appears to be a bug, and we might "fix" it in a future release.
Customers should use the currentFormatNames() API instead.