Variable javascript from one screen to another

Use this board to ask questions or have discussions with other Genie users.
Post Reply
Tracker
Profound User
Posts: 21
Joined: Fri Jun 26, 2015 7:49 am
First Name: Fadiga
Last Name: Mamoud
Company Name: Allianz Africa Services
Zip / Postal Code: 00225
Country: Ivory Coast
Contact:

Variable javascript from one screen to another

Post by Tracker »

Hi,
I want to use a Variable javascript from one screen to another. Can you help me please ?
lyarbrough
New User
Posts: 16
Joined: Mon May 08, 2017 11:51 am
First Name: Lillie
Last Name: Yarbrough
Company Name: Profound Logic
Contact:

Re: Variable javascript from one screen to another

Post by lyarbrough »

Hi Mamoud,

Could you give us more information about what you'd like to accomplish? What will you be using the variable for? The more information we have about this, the better we can help with a solution.

Thanks!
--Lillie
Tracker
Profound User
Posts: 21
Joined: Fri Jun 26, 2015 7:49 am
First Name: Fadiga
Last Name: Mamoud
Company Name: Allianz Africa Services
Zip / Postal Code: 00225
Country: Ivory Coast
Contact:

Re: Variable javascript from one screen to another

Post by Tracker »

I want to move from one skin to an other. I use the javascript

Code: Select all

pui.refresh({ skin: "myskin1" });
to change first skin myskin. but I want to return to skin myskin using a variable javascript and the variable

Code: Select all

var skinName = pui.skin;
is undefined in the second screen
User avatar
Emily
Profound Logic Staff Member
Posts: 89
Joined: Tue Jun 21, 2016 8:30 am
First Name: Emily
Last Name: Seage
Company Name: Profound Logic
Contact:

Re: Variable javascript from one screen to another

Post by Emily »

Just for some clarification on what you're wanting to accomplish here, are you saying that you want to change Genie skins between screens? For example, screen #1 would use skin 'myskin1' and then screen #2 would use skin 'myskin2'? Or is there something else you're wanting to do? We want to make sure we understand exactly what you're wanting so that we can help with finding a solution.

Thanks!

--Emily
Emily Seage
Support Team Lead
Tracker
Profound User
Posts: 21
Joined: Fri Jun 26, 2015 7:49 am
First Name: Fadiga
Last Name: Mamoud
Company Name: Allianz Africa Services
Zip / Postal Code: 00225
Country: Ivory Coast
Contact:

Re: Variable javascript from one screen to another

Post by Tracker »

yes !For example, screen #1 would use skin 'myskin1' and then screen #2 would use skin 'myskin2'.
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: Variable javascript from one screen to another

Post by Scott Klement »

Changing skins is very expensive in terms of performance. It involves wiping out everything in the current browser session, and re-downloading it from the server. I would never do that on a per-screen basis, unless this is a very unusual screen that will only be used very rarely.

Likewise. the "normal" way of saving a variable across screens will not work because you are wiping out everything in the session. So you will need to use something like the browser's localStorage to save your variable, and you will need to restore it when you resume.

Please explain why you want to switch skins on a per-screen basis, so that we can consider if there's a better way to do it.
Tracker
Profound User
Posts: 21
Joined: Fri Jun 26, 2015 7:49 am
First Name: Fadiga
Last Name: Mamoud
Company Name: Allianz Africa Services
Zip / Postal Code: 00225
Country: Ivory Coast
Contact:

Re: Variable javascript from one screen to another

Post by Tracker »

I have a program
        menu.rpgle (skin)
           
FM application
              ROI option 1 (skin1)
              TOI option 2 (skin)
            
               Choice:
assume that i select option 1 and i do my work and i return to menu.rpgle is still like this http://myi//profoundui/genie?skin=skin1 . and i would like this url
http://myi//profoundui/genie?skin=skin.

Option 1 and 2 are two differents applications and I want to call them in menu.rpgle
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: Variable javascript from one screen to another

Post by Scott Klement »

You can run as many applications in a single skin as you like. There is no need to switch skins to change applications.
Tracker
Profound User
Posts: 21
Joined: Fri Jun 26, 2015 7:49 am
First Name: Fadiga
Last Name: Mamoud
Company Name: Allianz Africa Services
Zip / Postal Code: 00225
Country: Ivory Coast
Contact:

Re: Variable javascript from one screen to another

Post by Tracker »

Of course, except that in our case there are a dozen options and the ROI option is very special. These are screens where all the elements are textbox. So you have to do it separately.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests