You'll need more code in keyFocusChangeHandler.  It has to not call
preventDefault when it is time to transfer the tab to the next renderer.

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Claudiu Ursica
Sent: Sunday, August 03, 2008 5:52 AM
To: [email protected]
Subject: [flexcoders] Re: Tabbing children from custom item renderer
inside List



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;
            
    &nb! sp;       
/** 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(even! t:FocusEvent):void
{
    trace("Focu! sHandler ");
    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"
    &nbs! p;   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>
    
 &n! bsp;&nbs p; <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


 

Reply via email to