My question is regarding cursor management.
My application displays list of members (using RPG and DSPF).
There is one input field per row, in which the user enteres the option he wishes to preform on the selected row.
The RPG processes the selected row, by the given option.
My question is:
When the RPG completes its process on the selected row - I re-display the screen. How can I place the cursor exactly on the input field in the row which the user selected before he hit 'ENTER'.
In other words, The user want to perform option number 2, and then option number 3 on the same row. I want him the have the cursor on the same row he started to work with when option 2 completes.
Currently, my cursor is placed on the input field of the FIRST row on the screen. I tried many suggestions. None helped.
thanks
Software/Hardware used:
ASKED:
November 9, 2005 9:44 AM
UPDATED:
November 19, 2009 3:34 PM
You didn’t tell us what you tried; only that what you tried didn’t work. That means we have to guess if you already tried what we might suggest.
How do you remove the option that the user entered from the option field? Bo you rewrite the subfile? Or do you issue an UPDATE to the subfile RRN to blank out just that one subfile option field?
Tom
Updating the subfile record with display attribute Position cursor in effect. If you have updated multiple records with this indicator active the cursor will be positioned on the first subfile record that has the display attribute in effect.
For your problem, this’ll work if the records displayed don’t change (1st stays 1st, 2nd stays 2nd) from when the Enter key is pressed to when the records are redisplayed.
On the SFLCTL record format, include this:
CSRLOC(ROW COLUMN) RTNCSRLOC(&FORMAT &FIELD) ROW 3S 0H COLUMN 3S 0HIn the RPG include this:
(I’m pulling this from an older program – don’t bust my chops for not using /Free).
If you want the cursor to assume the default position (first input-capable field on the format), simply clear row and column.
This isn’t limited to subfiles & has the advantage of not requiring any indicators.