Cursor jumps to first page during subfile reload DSPFIL with F11 Toggle
search cancel

Cursor jumps to first page during subfile reload DSPFIL with F11 Toggle

book

Article ID: 445867

calendar_today

Updated On:

Products

CA 2E

Issue/Introduction

While developing a Synon/2E program of the DSPFIL type, I'd like to add a comand key (F11 = “Other View”) that will allow me to change the label of an item of the subfile. 

I added this feature without any problems and can switch between the two labels just fine.

However, as soon as I press F11, the program reloads the subfile because I added :

PGM.*Reload subfile = CND.*YES

How can I display the second label in the record (by pressing F11) without the cursor jumping back to the first page of the subfile?

I'd like the F11 key to keep the cursor in its current position and have all the labels on the page change.

An example of the desired behavior is in the WRKJOBJS system command  With this command, when I scroll to the bottom and press F11 to change the view, a new column layout appears without the cursor moving from its position on the record

Environment

  • CA 2E 8.7.x
  • IBM i (AS/400)

Resolution

Use the *set cursor built-in function to achieve this requirement of controlling SFLRCDNBR..

  1. To do that, add the below code in the USER: Process command keys, user point

    That is called the *SET Cursor built-in function with a parameter of any control field.

  2. Then write one EXCUSRSRC program to set the current SFLRCDNBR field value (ZZSFRC) to the *Set cursor field value

    (here that is W0RR0)...

    So add one line(C                   Z-ADD     ZZSFRC        W0RR0 ) in the excusrsrc.