Scrolling in tables (RPG/DDS)

Please do not use to report errors- use your regional help desk.
Please mark posts as being for RPG or RDMLX (LANSA) developer.
To subscribe by email, display this forum, scroll to the end and select ‘Subscribe Forum’.
Post Reply
JoeHam
Posts: 14
Joined: Thu Jul 19, 2012 5:35 pm

Scrolling in tables (RPG/DDS)

Post by JoeHam »

If a table has more columns than can be shown on screen I can scroll sideways to see the remaining columns. This is working fine but the column headers remain fixed on top of the screen and do not fit together with the shown data.
How can this be changed?
MarkDuignan
Posts: 346
Joined: Wed Apr 18, 2012 10:33 am

Re: Scrolling in tables (RPG/DDS)

Post by MarkDuignan »

The simplest solution is to make the table (and your whole Form View) wider that the screen.

The shipped 'Advanced Examples' -> 'Using Tables' shows 9 different table display techniques. Use the ‘Next’ command to go to the ‘FormView_4 – Wide table – 50 Rows’ display for an example of a table that is wider than the screen. Code is in file LRNG_DEMO/SOURCEXAM members EXAM0004 (RPG) and EXAM0004D (DSPF).

What these examples do not show is how to make the table wider than the screen, allow it to scroll left and right with its headings, but prevent other things on the screen from also scrolling. This is slightly more complex to set up – but I can post an example if this is what you want to do.
Post.png
Post.png (96.25 KiB) Viewed 6072 times
JoeHam
Posts: 14
Joined: Thu Jul 19, 2012 5:35 pm

Re: Scrolling in tables (RPG/DDS)

Post by JoeHam »

Thank you, Mark
An example would be great - scrolling the list without moving the rest of the screen is exactly what we need.
MarkDuignan
Posts: 346
Joined: Wed Apr 18, 2012 10:33 am

Re: Scrolling in tables (RPG/DDS)

Post by MarkDuignan »

Attached find updated code for the shipped RPG building block “search and select” program.

Use is to replace shipped source code members:
• SEARCHSEL in LRNG_PROJ/QDDSSRC
• STDINCLUDE in LRNG_PROJ/QRPGLESRC
• SEARCHSEL in LRNG_PROJ/QRPGLESRC

Then recompile display file LRNG_PROJ/SEARCHSEL and RPG program LRNG_PROJ/SEARCHSEL.

When you run the RPG Build Block Search and select example you should now see 9 example columns in the table - noting that they will not all fit on the screen at once. The table can be scrolled left and right without scrolling the whole form. This makes it a simple design for dual purpose use on iPhones as well.
Shot.png
Shot.png (452.86 KiB) Viewed 6058 times
The main thing to note is how the DDS now define the table inside a form (or a sub-form might be a better name). This form fills the screen – but the table inside it can be as wide as you like and may be scrolled left and right independently of the outer form. This also means the subroutine AddResultsTableRow needs to use a slightly different LRNG_Using() operation to make sure it was addressing the row in the table in the sub-form.

The code is from the next LongRange version so I might have left something out + you get some other example stuff like alternated rows colours, search refinement, etc. If there’s a problem just post the details.
Attachments
LRNG_PROJ_QRPGLESRC_STDINCLUDE.TXT
(3.53 KiB) Downloaded 358 times
LRNG_PROJ_QRPGLESRC_SEARCHSEL.TXT
(14.38 KiB) Downloaded 324 times
LRNG_PROJ_QDDSSRC_SEARCHSEL.TXT
(10.05 KiB) Downloaded 382 times
MarkDuignan
Posts: 346
Joined: Wed Apr 18, 2012 10:33 am

Re: Scrolling in tables (RPG/DDS)

Post by MarkDuignan »

Here is a screen shot on an iPhone of the same program with the table scrolled about 2/3 across.
The table and its headings scroll left/right/up/down but the search buttons and fields do not move.
This seems like a reasonable way to show a lot of tabular information to an iPhone user – if that is what you need to do.
Shot2.png
Shot2.png (129.85 KiB) Viewed 6054 times
JoeHam
Posts: 14
Joined: Thu Jul 19, 2012 5:35 pm

Re: Scrolling in tables (RPG/DDS)

Post by JoeHam »

Thank you Mark,
this is exactly what I had in mind!
MarkDuignan
Posts: 346
Joined: Wed Apr 18, 2012 10:33 am

Re: Scrolling in tables (RPG/DDS)

Post by MarkDuignan »

This example is now shipped with LongRange.
See http://longrange.lansa.com.au/viewtopic.php?f=13&t=111
Post Reply