Page 1 of 1

Switching screens inside one format

Posted: Fri Dec 14, 2012 4:31 am
by mkilp
Hey there,

we are experiencing problems while using DDS converted formats in a php script.
We created a simple test format with 2 screens and now we simply want to switch to the second format by pressing the F9 function key.

At the moment we created a button with the onClick event pressKey("f9").

But we get an error:

Code: Select all

OnClick Error: Object expected
we already tried to work with the documentation, but there is not that much info about switching between screens in 1 format.

Below is our php code:

Code: Select all

<?php 
 $view = '/profoundui/userdata/dspf/HelloWorld2.json';  
$output = array('view' => $view, 'screen' => 'DIALOG01'); 
 echo json_encode($output);
 ?>
The second screeen is called DIALOG02.


I hope you are able to help us and if further questions occur feel free to ask.

Kind Regards,

Marvin

Re: Switching screens inside one format

Posted: Fri Dec 14, 2012 3:18 pm
by Scott Klement
HI Marvin,

pressKey() Is a Genie API. Genie is a tool that works like a 5250 emulator that translates 5250 screens on-the-fly to web pages. That's not what you are using, here. There's no 5250 screen involved here at all, you're displaying a Rich Display using our JavaScript framework.

I'm having a hard time understanding what you're trying to accomplish here. How does F9 relate to switching screens? Can you clarify how your screen works?

Re: Switching screens inside one format

Posted: Mon Dec 17, 2012 4:18 am
by mkilp
Hi Scott,

first off: thank you for your reply.

The function key f9 switches the screen inside the *pgm behind the format file.

For better understanding i give you an example:

You start in the format DIALOG01.
There you can do some input.
Then you press F9 and now you are in DIALOG02.

Note: DIALOG01 and 02 are the name of the screens.
Thats how our simple testpgm works.

regards,

Marvin

Re: Switching screens inside one format

Posted: Mon Dec 17, 2012 8:29 am
by kfritz
Define the button as F9 button and give the "response" property the bound value *in09 or what ever you want. This returns the indicator value back to your RPG program. You don't need pressKey (as Scott explained a Genie function) or a pui.click event. This should work.

I assume you're using the F9 key instead the enter key.

Re: Switching screens inside one format

Posted: Mon Dec 17, 2012 8:38 am
by mkilp
Well, i already defined the response to *in09 and it didnt work.

May it be a problem that my program behind the format is written in JCL?

Re: Switching screens inside one format

Posted: Mon Dec 17, 2012 10:48 am
by Scott Klement
mkilp wrote:The function key f9 switches the screen inside the *pgm behind the format file.
This sounds like you're using Genie? In Genie, you use existing programs with existing 5250 screens, and the screens are transformed on-the-fly. Genie is really a 5250 emulator that converts old-style screens to web pages as you run them.

However, the code you posted is PHP code that's displaying screens created as Profound UI Rich Display files. All it does is display screens from your PHP program. The only program code that's running is the PHP code, itself.
mkilp wrote: You start in the format DIALOG01.
There you can do some input.
Then you press F9 and now you are in DIALOG02.
That description would make sense (again) if you were displaying 5250 screens in Client Access or in our Genie product. It does not make sense, however, given that you are writing a PHP script for a web application.

If you want to handle the F9 key, as you describe, you have to have the F9 assigned to a button -- the button would submit the screen back to your PHP program, which would then check for F9, and you'd then have logic to switch to another screen.

The two screens would be separate formats (not "1 format" as you said in yoru first message.)