Page 1 of 1
Multi-row subfile.
Posted: Tue Jul 07, 2015 7:04 am
by vijo
Hi
I have a problem with this kind of subfile.
They display like the following when they contain multiple entries (all fields are concatened and separated by whitespace):
- triplesubfile1.png (41.54 KiB) Viewed 1303 times
and like the following when they contain only one entry (some fields are not included):
- subfile2.png (25.39 KiB) Viewed 1303 times
How would you deal with this ?
Re: Multi-row subfile.
Posted: Tue Jul 07, 2015 9:17 am
by Scott Klement
Since you posted this in the Genie forum, I assume this is on a 5250 screen with a subfile created by the 'detect subfile' options? Is that true?
If at all possible, I would use a Rich Display for this instead of a 5250 display, that will be a lot easier to code, maintain, etc.
But if you must do it with a 5250 screen, I would turn off the subfile detect for this screen, drag your own grid onto the display from the widgets toolbar, and load the data into the grid using JavaScript in an 'onload' event. The JavaScript would loop through the data on your screen, and add the fields into the grid.
It's important to realize, however, that the only data that's available on a 5250 screen is what you see on the display. In this case, your screen shows only 4 rows of data -- so that's all the data you'd be able to put into a grid. You could make the grid fit on a single line and scroll right/left to get all of the fields, but you would not be able to put more than 4 rows on the display because you simply won't have the data for the other rows.
Using a Rich Display this wouldn't be a problem, and you wouldn't have to do the JavaScript coding, you'd just load the grid fields directly from your RPG program like any other subfile. Would be much more elegant.
We are working on new features for Genie that will give some open access capabilities to improve stuff like this in the future -- but I do not know when this will be available.
Re: Multi-row subfile.
Posted: Tue Jul 07, 2015 10:16 am
by vijo
Since you posted this in the Genie forum, I assume this is on a 5250 screen with a subfile created by the 'detect subfile' options? Is that true?
You guessed right.
If at all possible, I would use a Rich Display for this instead of a 5250 display, that will be a lot easier to code, maintain, etc.
Sure it would be more elegant I will look if it is possible to use Rich Display. If not I'll try the Javascript approach.
Thank you so much.
Re: Multi-row subfile.
Posted: Mon May 15, 2017 3:58 pm
by k2R400
Scott Klement wrote: The JavaScript would loop through the data on your screen, and add the fields into the grid.
Scott,
Dou you have an example ?
Thank you in advance
Re: Multi-row subfile.
Posted: Mon May 15, 2017 4:28 pm
by Scott Klement
This post is from 2 years ago. In re-reading my message, I don't even remember what I was referring to, here... I'm sure we don't have an example for this, it sounds like an unusual situation.