The Profound UI environment uses what's called a "Single Page Application". This means that each time you start a session, there is only one web page shown. Each time a display changes, it uses DHTML to modify the web page. This allows for the fastest performance and the most RPG-like behavior.
Unfortunately, this also means that in order to open a new browser tab, you have to start a new Profound UI session. That session will start over with regards to signing on to the system, setting up it's library list, and so forth.
One easy way to solve the sign-on issue is to use browser authentication. To do that, start your sessions with an /auth/ URL like this:
http://YOUR-SERVER:PORT/profoundui/auth/start
Using /auth/ like this causes the browser to prompt you for sign on information rather than showing the sign-on screen. The advantage to that is that the browser will remember your sign on until you close the browser. You can, therefore, launch as many sessions as you want without signing on again.
With that in mind, you can launch a new session in a new window with JavaScript. For example, add a button to your screen and set the "onclick" event to code like this:
Code: Select all
window.open("/profoundui/auth/start");
Now comes the tricky part... making it run a different program in the new session. To do that, I would recommend creating a CL program that is set as the user's "initial program". You can pass parameters to that CL program to tell it what to start. For example, the CL program may look like this:
Code: Select all
PGM PARM(&TEMP)
DCL VAR(&TEMP) TYPE(*CHAR) LEN(10)
DCL VAR(&PGM) TYPE(*CHAR) LEN(10)
CHGVAR VAR(&PGM) VALUE(&TEMP)
MONMSG MSGID(CPF0000) EXEC(DO)
CHGVAR VAR(&PGM) VALUE(DFTPGM)
ENDDO
CALL PGM(&PGM)
MONMSG MSGID(CPF0000) EXEC(DO)
DSPJOBLOG OUTPUT(*PRINT)
MONMSG CPF0000
ENDDO
ENDPGM
So this program will call an RPG program named 'DFTPGM' if no parameters are passed to it. Or, if a parameter is passed, it will call a program with whatever program name is given in the parameter. Many more things could be done in this CL program, of course... For example, it could validate that the program is in a list of allowed programs. And/or it could have code to set up the library list, etc. I'm sure you can modify it to suit your needs.
Anyway, set the user's intiial program to the above program. For example, if this program is called STARTPUI then the initial program could look like this:
- startpui.png (23.93 KiB) Viewed 3027 times
Now that user starts his session at http://YOUR-SERVER:PORT/profoundui/auth/start and it will run DFTPGM.
Then DFTPGM has a Rich Display containing a button that opens a new tab. In that new tab you want to run PGM2, so you set the 'onclick' for the button to:
Code: Select all
window.open("/profoundui/auth/start?p1=PGM2&l1=10");
This starts PGM2 in the new tab.. because you used /auth/, it does not ask for the userid/password again, but automatically logs on with the same userid/password as before.
Hope that helps!