Hey I got an solution for this.
Here is an solution for focus issue of Itemrenderer's textinputs -
package
{
public class MyList extends List
{
public function MyList ()
{
super();
}
// Set focus to childerns on "Tab" key press (Tab Navigation)
override protected function createChildren():void {
super.createChildren();
this.listContent.tabChildren = this.tabChildren
this.listContent.tabEnabled = this.tabEnabled
}
}
}
If anyone facing same problem then please try out above solution. This works
perfect!
Cheers,
Nilesh Pawar
--- In [email protected], Alex Harui <aha...@...> wrote:
>
> TileList is not designed to support focusable renderers. You may have to
> borrow code from List or DataGrid.
>
>
> On 5/14/10 6:52 AM, "Akshar Kaul" <akshar.k...@...> wrote:
>
>
>
>
>
>
> use tabindex property to set the order in which you want to set the focus
> using tab key...
>
> Akshar Kaul
>
>
> On Fri, May 14, 2010 at 11:04, Nilesh <pawarnil...@...> wrote:
>
>
>
>
>
> Hello Members,
>
> I am facing problem with textinput focus on keyboard "Tab" key.
>
> Is there any way to get focus on next fields through keyboard "Tab" key?
>
> Here is sample code of my example -
>
> /* test.mxml */
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="init()"
> layout="vertical">
> <mx:Script>
> <![CDATA[
> import myItemRenderer;
> private var tempSelArray:Array=[
> {label: "I am CommonText", inputType:"CommonText"}, {label: "I am InputText
> 01", inputType:"CommonText"},
> {label: "I am TextArea 01", inputType:"AreaText"}, {label: "I am InputText
> 02", inputType:"CommonText"},
> {label: "I am TextArea 02", inputType:"AreaText"}, {label: "I am TextArea
> 03", inputType:"AreaText"},
> {label: "I am InputText 03", inputType:"CommonText"},{label: "I am InputText
> 04", inputType:"CommonText"}
> ];
>
> private function init():void{
> addedFields.dataProvider = tempSelArray;
> addedFields.itemRenderer = new ClassFactory(myItemRenderer);
> }
> ]]>
> </mx:Script>
> <mx:VBox width="100%" height="100%" >
> <mx:TileList id="addedFields" height="400" verticalScrollPolicy="off"
> rollOverColor="0xffffff" selectionColor="0xffffff"
> columnCount="1" columnWidth="{this.width-100}" rowHeight="50" width="100%" />
> </mx:VBox>
> </mx:Application>
>
>
> /* myItemRenderer.mxml */
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
> implements="mx.managers.IFocusManagerComponent" width="100%">
> <mx:Script>
> <![CDATA[
> import mx.containers.HBox;
> import mx.controls.Label;
> import mx.controls.TextArea;
> import mx.controls.TextInput;
> private var textField:TextInput = new TextInput();
> private var textArea:TextArea = new TextArea();
> private var textLabel:Label = new Label();
>
> private var hb:HBox = new HBox();
>
> override public function set data(value:Object):void
> {
> if(value != null)
> {
> super.data = value;
>
> textLabel.setStyle("color","0x000000");
> textField.setStyle("color","0x000000");
> textArea.setStyle("color","0x000000");
>
> switch(data.inputType){
> case("CommonText"):{
> textLabel.text = data.label + " :";
> // Create inputtextField and add to this
> hb.addChild(textLabel);
> hb.addChild(textField);
> this.addChild(hb);
> }
> break;
> case("AreaText"):{
> textLabel.text = data.label + " :";
> // Create inputtextArea and add to this
> hb.addChild(textLabel);
> hb.addChild(textArea);
> this.addChild(hb);
> }
> break;
> }
> }
> }
> ]]>
> </mx:Script>
> </mx:Canvas>
>
>
>
>
>
>
>
>
>
>
> --
> Alex Harui
> Flex SDK Team
> Adobe System, Inc.
> http://blogs.adobe.com/aharui
>