Browser cursor selection

Use this board to ask questions or have discussions with other Genie users.
Post Reply
sunny
Profound User
Posts: 29
Joined: Wed Sep 08, 2021 1:01 pm
First Name: Sunny
Last Name: Krowski
Company Name: United Cerebral Palsy Arkansas
Phone: (501) 224-6067
Address 1: 9720 N Rodney Parham Rd
City: Little Rock
State / Province: Arkansas
Zip / Postal Code: 72227
Country: United States
Contact:

Browser cursor selection

Post 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?
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Browser cursor selection

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests