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;
}
}
}
}
But when calling the exact same form using ENTER NEW, I see it blink once in the empty Descr. field, and then go away. 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.