Ok, I managed to send the focus to the second numeric stepper, but when
I hit tab again I loose the tab and cannot sent the focus to the second
item in the list on the first numeric stepper.
Now my code looks something like this:
<mx:HBox
xmlns:mx="http://www.adobe.com/2006/mxml"
implements="mx.managers.IFocusManagerComponent"
width="100%"
height="100%"
verticalAlign="middle">
.............. skins and other stuff ......
<mx:Script>
<![CDATA[
import mx.managers.IFocusManagerComponent;
import mx.collections.ArrayCollection;
import mx.controls.List;
/** EVENT HANDLERS **/
private function itemRendererDeleteButtonHandler(event:MouseEvent) :
void {
// lista va fi tot timpul si in toate situatiile
itemRenderer.parent.parent
var parentList : List = this.parent.parent as List;
var parentListDataProvider:ArrayCollection = parentList.dataProvider as
ArrayCollection;
var itemIndex:int = parentList.itemRendererToIndex(this);
parentListDataProvider.removeItemAt(itemIndex);
}
public override function set data (val : Object) : void
{
super.data = val;
}
override protected function focusInHandler(event:FocusEvent):void
{
trace("FocusHandler");
addEventListener("keyFocusChange", keyFocusChangeHandler);
}
protected function keyFocusChangeHandler(event:FocusEvent):void
{
event.preventDefault();
trace(event.target);
stepperTwo.setFocus();
}
]]>
</mx:Script>
<mx:Spacer width="10" />
<mx:NumericStepper id="stepperOne"
minimum="2"
maximum="100"
width="46"
height="20"
cornerRadius="3"
backgroundColor="white"
borderStyle="solid"
borderThickness="0"
tabEnabled="true">
</mx:NumericStepper>
<mx:Spacer width="10" />
<mx:NumericStepper id="stepperTwo"
minimum="2"
maximum="100"
width="46"
height="20"
cornerRadius="3"
backgroundColor="white"
borderStyle="solid"
borderThickness="0"
tabEnabled="true">
</mx:NumericStepper>
<mx:Button
tabEnabled="false"
id="buttonRemoveItem"
width="15"
height="14"
styleName="removeItemButtonSkin"
click="itemRendererDeleteButtonHandler(event)"
buttonMode="true"
/>
<mx:Spacer width="5" />
</mx:HBox>
As said before the only components that I am interested in being in the
tabloop are the 2 numeric steppers. Maybe I'm missing something but
when the focus is on the "stepperTwo" and I hit tab it goes away. I have
no idea how to send the focus on the second item in the list, eg the
first numeric stepper of the second item...
I have tried to do stuff in the focuOut evt handler for the second
numeric stepper but it doesn't seem to work ....
TIA,
Claudiu