Page 1 of 1
Retention of display position after processing.
Posted: Tue Feb 05, 2013 3:56 pm
by alexamores
We have one record format on a display file that causes vertical scrolling. The user has to scroll down to enter data on the elements. After hitting the enter key or clicking on the button, the control passes back to the RPG program for processing and re-display the record formats. But this time the screen scrolls up hiding the last element where the user is working. How can we retain this last position of the display? Any help is appreciated.
Re: Retention of display position after processing.
Posted: Fri Feb 08, 2013 5:15 pm
by alexamores
This condition happens when you are in a tabular screens and each individual tab is a call to an independent program. Found a work around to prevent the screen from scrolling down. It would be nice if a "Place Cursor" properly is made available to a non subfile grid screen. The set focus will work, but is available only to certain widgets and if you hide that widget, set focus will not work anymore.
Re: Retention of display position after processing.
Posted: Fri Mar 01, 2013 10:33 am
by David
Glad you found a workaround. I think you're right -- setting focus is the only way to make it scroll things into view, and there are some limitations there as you say.
It might be possible to add a new property where you can specify a widget to 'scroll into view' -- our development team will take this into consideration for a future update.
Re: Retention of display position after processing.
Posted: Fri Mar 01, 2013 11:33 am
by David
It's possible to call the necessary JavaScript code directly to scroll any item into view.
See here:
https://developer.mozilla.org/en-US/doc ... llIntoView
In PUI, you could call this from the record format's 'onload' event, like this:
Code: Select all
// Use 'id' property (case-sensitive) of widget you'd like to scroll into view.
getObj('YourWidgetId').scrollIntoView(true);