I have created an extension of the DateField() (ValidatedDateField())
component. The main purpose of this extension is to call an extension to
the TextInput component.
Everything seems to work swimmingly. I have found that in some cases
however, the tab key (tab index order) handling gets messed up. Because
of the poor tab handling design in flex, the method that we use to
control the tab order is by placing the fields in the order in the mxml
file that we want. This seems to work most of the time.
I have found that on forms where the custom datefield components are in
a TabNavigator canvas that the ValidatedDateField() that I have created
will cause the tab order to break. In one case it causes the focus to go
to a dataGrid in another container above the one the
ValidatedDateField() is in. My best guess is that it causes the next
field to be the first editable field within the TabNavigator canvas that
the datefield is in.
If I make the field editable=false, the tabbing seems to work fine
irrespective of the TabNavigator.
My conclusion is that when the custom "TextInput" portion of the
DateField gets instantsiated the tab order gets hosed.
I have looked through the code for the ComboBase and DateField to see if
I can tell where the tab order gets defined and I can't see it. I saw a
line that says;
textInput.parentDrawsFocus = true;
and thought that might have something to do with it, but I can't
replicate that in my code, I get an "inaccessible" error.
If my assumption that I am not creating the textInput component
correctly is true, the question is;
How can I ensure that the custom textInput component portion of my
DateField component gets the same tab order as the DateField itself?
Here is the creatChildren method of the custom DateField Component;
override protected function createChildren():void {
super.createChildren(); removeChild(textInput);
if(this.textInput) { // Use ValidatedTextInput instead of TextInput
and Setup various fields //needed by ValidatedTextInput
textInput = new ValidatedTextInput(); textInput["dataType"] =
"date"; textInput["formatter"] = "_dateFormat";
textInput["minDataChars"] = _minDataChars; textInput["maxDataChars"]
= _maxDataChars; textInput["minValue"] = _minValue;
textInput["maxValue"] = _maxValue; textInput["id"] = "vti" +
this.id; textInput["rootOwner"] = this.parent;
textInput["charactersAlsoPermitted"] = _charactersAlsoPermitted;
textInput["formatData"] = _formatData; textInput["doValidateData"] =
_doValidateData; textInput["defaultValue"] = _defaultValue;
textInput.addEventListener("focusOut",updateTextValue)
textInput.addEventListener("textChanged",updateTextValue)
addChild(textInput); } }
Since the application that I am working on contains a number of "heads
down" data entry environments, this is a critical issue for me.
All help is greatly appreciated.
Paul