Multi-row subfile.

Use this board to ask questions or have discussions with other Genie users.
Post Reply
vijo
Profound User
Posts: 28
Joined: Thu Jun 25, 2015 4:47 pm
First Name: Vincent
Last Name: Jonis
Company Name: oo2
Contact:

Multi-row subfile.

Post 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
triplesubfile1.png (41.54 KiB) Viewed 1118 times
and like the following when they contain only one entry (some fields are not included):
subfile2.png
subfile2.png (25.39 KiB) Viewed 1118 times
How would you deal with this ?
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: Multi-row subfile.

Post 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.
vijo
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.

Post 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.
k2R400
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.

Post 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
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: Multi-row subfile.

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest