Page 1 of 1

Browser cursor selection

Posted: Mon Dec 06, 2021 4:23 pm
by sunny
When a user types in data into a field, I want to update the information that was entered before going to the next field.
I have pressKey("Enter", true); on the ONCHANGE properties. The issue is that when it updates, it comes back and the cursor is no longer on the next field but yet has gone back to the first tab and the first field.

I tried

On the screen
ONLOAD var lastTab = sessionStorage.getItem("MYSCREEN_LASTTAB");
if (lastTab) {setTab("TabPanel1", lastTab)}

On the Tab
ONTABCLICK sessionStorage.setItem("MYSCREEN_LASTTAB", tab);


This didn't work. When the update happens, it still comes back to the first tab on the first field.

How can I get the cursor to return to the next field just as a tab?

Re: Browser cursor selection

Posted: Mon Dec 06, 2021 5:34 pm
by Scott Klement
Is this a 5250 screen? This really isn't the way 5250 screens were meant to work. The idea is that the server sends an entire screen, and the user makes changes, then submits the entire screen back. You seem to want it to operate on a single field at a time.

Regardless of whether it's 5250 or Rich Display, using pressKey("Enter") is going to submit control back to the server. When the server is done processing, it outputs a new screen. It's up to the server whether to redisplay the current screen or output a new one. Profound UI doesn't know which one it has done -- so it always wipes the entire screen out and draws a new one based on what the server has sent.

So what you're doing is completely wiping out the display, and then trying to figure out how to code things to put it back where it left off as if nothing happened. This is certainly possible, but seems like it'd be a lot of work -- and it's going to be awkward from the user's perspective as well, because they won't be able to type while the server is doing it's processing.

Instead, I would suggest:
  1. If it's a 5250 screen, replace it with a Rich Display.
  2. Redesign the application to use AJAX rather than submitting the screen. This will allow you to do validation and database updates on-the-fly without having to completely wipe out and redraw the screen.