Page 1 of 1
Bound "Set Focus" not working
Posted: Mon Feb 15, 2021 5:15 pm
by RichDotsonMTD
I have a UI where all the entry fields have a bound indicator field on the "Set Focus" property. If the data is invalid I move *On to the bound field and redisplay the UI but the field in error does not receive focus. All the fields are defined the same way and none of them receive focus as expected.
Any ideas?
.
.
Re: Bound "Set Focus" not working
Posted: Mon Feb 15, 2021 5:33 pm
by Scott Klement
Run the screen so that it attempts to set focus like you want it to. When it fails and you're seeing the screen with focus in the wrong place, hit Ctrl-F9 to create a dump of the screen.
Post that dump here. This will give us complete information on what's happening.
Re: Bound "Set Focus" not working
Posted: Mon Feb 15, 2021 5:42 pm
by RichDotsonMTD
Attached is the downloaded JSON. I was expecting the uiOnlineOrder field to have focus.
The RPGLE code setting the bound field value is: focusOnline = *On;
.
Re: Bound "Set Focus" not working
Posted: Mon Feb 15, 2021 7:21 pm
by Scott Klement
I tried your screen, and focus seems to be going into the "Online Order" field just as you would expect.
- dotson_focus.png (35.42 KiB) Viewed 1604 times
You are loading a number of external javascript and css files that I don't have. Perhaps one of them is changing the focus... but without them, focus goes exactly where you say it should.
Re: Bound "Set Focus" not working
Posted: Tue Feb 16, 2021 10:14 am
by RichDotsonMTD
It's good to know that I have the fields setup correctly. I am using a custom function to enhance the display of my "alert" error messages. I'll research the css/js for that function to see if it's affecting the focus in some way.
Thanks!