Page 1 of 1

Is is possible to consolidate two green screens into one on browser.

Posted: Mon Jan 31, 2022 11:57 pm
by sgonchigar2
Hello, Wondering if it is possible to consolidate two/multiple screens into one on browser using Genie without changing the RPG code. Example we have one screen to search by customer number and another to search by customer name. A function key is used to toggle between the two. I was thinking if we can put these two green screens as two tab window. I went thru some of the other posts. Would you point me to multiStepAction examples.

Re: Is is possible to consolidate two green screens into one on browser.

Posted: Tue Mar 01, 2022 5:25 pm
by sgonchigar2
Hello, any suggestions as how to accomplish this. we have a subfile, option 5 to display the record in detail, detail_screen1, detail_screen2, detail_ screen3, detail_screen4. 5250 navigation to each detail screen is "enter key". On last screen, enter takes you back to the subfile. I would like to see if we can load detail_screen2,3 and 4 on detail_screen1.

Re: Is is possible to consolidate two green screens into one on browser.

Posted: Tue Mar 01, 2022 11:27 pm
by sgonchigar2
I tried this:
1. declared global variable in custom.js: var savedScreenData = [];
2. On Detail_Screen1:

Code: Select all

       .... onpageload:  "screen": { "screen_name": "Client ID", "onpageload": "\n", "onload": "savedScreenData.push(getAllFields()); \nvar steps = 
             [];\nsteps.push(\"pressKey('Enter')\");\nmultiStepAction(steps);" },
3. On Detail_Screen2: onpageload, I am trying to display previous screen values but shows current/Detail_screen2 data instead of detail_screen1

Code: Select all

 for (var i = 0; i < savedScreenData.length; i++) {
    var fields = savedScreenData[i];
    for (var j = 0; j < fields.length; j++) {
      var field = fields[j];
      var value = get(field.id);
      console.log(field + ' ' + value);
    }
}

Re: Is is possible to consolidate two green screens into one on browser.

Posted: Wed Mar 02, 2022 2:01 pm
by Scott Klement
I don't understand what you're trying to achieve.

The way the code reads: Save all elements on screen1. If the same element exists on screen2, log it to the console. It's not clear why someone would want to do that?

Re: Is is possible to consolidate two green screens into one on browser.

Posted: Wed Mar 02, 2022 2:50 pm
by sgonchigar2
all I was trying to do was to save screen1 elements and use it on screen2. that console -display was just a test to see if I am getting the screen1 data. Would like to see if screen1, screen2 and screen 3 be made available on screen 4 to consolidate 1,2,3 into 4.

Re: Is is possible to consolidate two green screens into one on browser.

Posted: Wed Mar 02, 2022 8:24 pm
by Scott Klement
Keep in mind that if you add elements that weren't on the original screen, you won't be able to submit them back to the program running on the server, because it is reading the record format of a DDS screen that won't have the elements you've added.

If they are output-only type things, it should work fine.

However, when you call get(field.id) you are reading the IDs from the previous screen, but using them to do a get() of elements on the current screen. You'd have to add the elements to the current screen before you could try to use get() on them.

Re: Is is possible to consolidate two green screens into one on browser.

Posted: Tue May 17, 2022 3:59 pm
by sunny
You can hide fields on screen one and then you have them when you are on screen 2 but don't have to see them on screen 1.