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):
and like the following when they contain only one entry (some fields are not included):
How would you deal with this ?
Multi-row subfile.
-
- Profound User
- Posts: 28
- Joined: Thu Jun 25, 2015 4:47 pm
- First Name: Vincent
- Last Name: Jonis
- Company Name: oo2
- Contact:
-
- 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: Multi-row subfile.
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.
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.
-
- Profound User
- Posts: 28
- Joined: Thu Jun 25, 2015 4:47 pm
- First Name: Vincent
- Last Name: Jonis
- Company Name: oo2
- Contact:
Re: Multi-row subfile.
You guessed right.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?
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.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.
Thank you so much.
-
- Profound User
- Posts: 62
- Joined: Sat Feb 18, 2012 12:03 pm
- First Name: Patrick
- Last Name: THOMAS
- Company Name: Oo2
- Country: France
- Contact:
Re: Multi-row subfile.
Scott,Scott Klement wrote: The JavaScript would loop through the data on your screen, and add the fields into the grid.
Dou you have an example ?
Thank you in advance
-
- 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: Multi-row subfile.
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.
Who is online
Users browsing this forum: No registered users and 1 guest