0 Replies Latest reply on Jun 5, 2010 6:54 PM by mazrit

    Using setFocus in a Repeater


      I am currently using a Repeater for bulk submissions and have run into a problem. Any idea how I reset focus on on newly created text field in a repeater  row?


      My Repeater is made up of gridrows. Each gridrow holds multiple text inputs as well as a link button that kicks off my addRow event. Here's a sample of the code:


      <mx:Grid id="params" width="100%" height="100%" >
                  <mx:Repeater id="paramRepeater" dataProvider="{drivers}"  >
                              <mx:TextInput id="txtFirst" text="{paramRepeater.currentItem.firstTextField}" change="paramValueChangeFirst(event)" />
                              <mx:TextInput id="txtSecond" text="{paramRepeater.currentItem.secondTextField}" change="paramValueChangeSecond(event)" />
                              <mx:TextInput id="txtThird" text="{paramRepeater.currentItem.thirdTextField}" change="paramValueChangeThird(event)"/>

                              <mx:LinkButton icon="../images/add.png')" click="addRow(event)" styleName="linkButton" toolTip="Add New Row" />




      All of this can be navigated by tabbing through the text fields the hitting the [enter] key to add a new row. (My users prefer to not use a mouse as they are basically doing data entry). Everything works fine except I cannot seem to setFocus on the "txtFirst" text input. I've tried variations of:


                  private function resetFocus():void{




      No luck. Any help would be greatly appreciated.