Subfile top row for a filtered subfile

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
mperez
New User
Posts: 9
Joined: Tue Sep 10, 2019 10:24 am
First Name: Michael
Last Name: Perez
Company Name: Manhattan Life Insurance
Contact:

Subfile top row for a filtered subfile

Post by mperez »

I see that the "subfile return rrn" grid property will return the top visible row of the subfile, and this works correctly for an unfiltered subfile but how do I get it to return the correct top row for a filtered subfile? It does display the correct filtered row as I scroll but doesn't seem to use that value in the SFLRRRN property.

My subfile has the persist state set to "session only" so it keeps the current column filter active when the subfile is redisplayed (i.e. a user has selected a record from the subfile, modified it, and wants to return to the same position in the filtered subfile). The problem is the "subfile return rrn" grid property value is set to the unfiltered rrn when it returns to the program (after the EXFMT stmt).

Grid properties:
subfile record number = SFLRCD
subfile return rrn = SFLRRRN
position at top = true
persist state = session only

RPG:
SFLRCD = SFLRRRN;
EXFMT C01;

Thanks.
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: Subfile top row for a filtered subfile

Post by Scott Klement »

mperez wrote:I see that the "subfile return rrn" grid property will return the top visible row of the subfile, and this works correctly for an unfiltered subfile but how do I get it to return the correct top row for a filtered subfile? It does display the correct filtered row as I scroll but doesn't seem to use that value in the SFLRRRN property.
The "subfile return rrn" property is the Rich Display equivalent of the 5250 SFLSCROLL keyword. The green-screen environment has no knowledge of filtering. Indeed, the filtering is intended to be handled entirely in the web browser so that you don't need to code your own filtering in your application. it is meant to be completely invisible to the back-end program (back-end = the RPG or Node.js program running on the server)

So, we cannot add filtering knowlege to "subfile return rrn" because it would break existing programs that were converted from green-screens or written to work like green-screens.
mperez wrote: My subfile has the persist state set to "session only" so it keeps the current column filter active when the subfile is redisplayed (i.e. a user has selected a record from the subfile, modified it, and wants to return to the same position in the filtered subfile). The problem is the "subfile return rrn" grid property value is set to the unfiltered rrn when it returns to the program (after the EXFMT stmt).
Maybe I'm not understanding? Why not use "cursor record number" to return the RRN that the user left off on, then use "subfile record number" & "place cursor" to return the user back to the same row?

Since they can't have the cursor position on a row that's filtered-out, this shouldn't cause the same problem.
mperez
New User
Posts: 9
Joined: Tue Sep 10, 2019 10:24 am
First Name: Michael
Last Name: Perez
Company Name: Manhattan Life Insurance
Contact:

Re: Subfile top row for a filtered subfile

Post by mperez »

I did switch to use the cursor record number but it too was holding the unfiltered rrn. Since filtering is done on the client side, I added the following to the onclick() event of the selection widget in the grid, which gives me the filtered rrn/row of the selected row in the grid.

hidden bound fld: ROWNO

widget: selection box
onclick event:
rrnRowNum = getObj("S01").grid.getRowNumber(rrn);
changeElementValue('ROWNO', rrnRowNum);

I set ROWNO to SFLRCD in the RPG and the screen redisplays at the same row in the filtered grid. Is it possible to get the top visible row of the grid on the client side, similar to getting the selected row number?

Thanks!
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: Subfile top row for a filtered subfile

Post by Scott Klement »

Sorry, I've never looked into how to retrieve the top row number.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests