More Park on 1st field woes

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Jaymer
Posts: 2454
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

More Park on 1st field woes

Post by Jaymer »

Per the thread here: https://www.awareim.com/forum/viewtopic.php?f=1&t=9785

I have added the script to just one form's init area:

Code: Select all

AwareApp_FormParser.prototype.setFocus=function(sectionName) {
if (this.m_fields ) {
var firstTabIdx = null, focusSet = false;
for (var i = 0, len = this.m_fields.length; i < len; ++ i) {
var f = this.m_fields [i];
var tabIndex = f.getTabIndex (); 
if (tabIndex && tabIndex == "1") {
firstTabIdx = f;
if ((! sectionName || sectionName == f.getSectionName ()) && f.setFocus ())
focusSet = true;
break;
}
}
if (! focusSet) {
for (var i = 0, len = this.m_fields.length; i < len; ++ i) {
var f = this.m_fields [i];
if (f != firstTabIdx && (! sectionName || sectionName == f.getSectionName ()) && f.setFocus ())
break;
}
}
}
}
When I call that form with an EDIT, it positions the insert carat in the front of the Description field - perfect.
But when calling the exact same form using ENTER NEW, I see it blink once in the empty Descr. field, and then go away.
Screen Shot 2018-03-05 at 12.14.28 PM.png
Screen Shot 2018-03-05 at 12.14.28 PM.png (39.25 KiB) Viewed 3124 times
At first I thought the issue was the Combo box at the top. So I moved it to the bottom, even REMOVED it with no joy.
When in CREATE Mode, the focus is being moved to the CREATE button - I KNOW this. I can see it. I can hit Tab once, then Shift Tab and its back on CREATE.

In this case the user has to manually move to the Description (with the mouse) field to start typing.

As an aside, the behavior is really the opposite of what I think a user would like.
(Using Popups...)
If you are clicking on a row in a grid to drill down to see more details, WITH NO script MOVEMENT to the 1st field, you have been able to tap ESC to close the window. If we force the park to the 1st entry field, then you can't hit ESC. You must go find the <Close> button.
Similarly, if you clicked a Create/New button, then you know you want to enter data, so parking inside the first field is great because the likelihood of cancelling with an ESC is not a common need.
I'm just seeing this work 180deg from the way I need it to.
If I was able to make the park work for NEW mode, then I'd have to have a seperate form for Add & Edit, one the used the parking script and one that doesn't need it.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Post Reply