# Advance text field components in flex reapeater

**URL:** <https://forum.inductiveautomation.com/t/advance-text-field-components-in-flex-reapeater/63629>\
**Category:** Ignition\
**Tags:** perspective, scripting\
**Created:** [August 30, 2022, 8:52pm UTC](https://forum.inductiveautomation.com/t/advance-text-field-components-in-flex-reapeater/63629 "2022-08-30T20:52:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kiet\_Vo](https://avatars.discourse-cdn.com/v4/letter/k/7ea924/32.png) [@Kiet\_Vo](https://forum.inductiveautomation.com/u/Kiet_Vo)\
**Post date:** [August 30, 2022, 8:52pm UTC](https://forum.inductiveautomation.com/t/advance-text-field-components-in-flex-reapeater/63629/1 "2022-08-30T20:52:24Z")

</div>

I have a flex repeater contains multiple repeated rows, each row has 2 text field components. I would like to have script automatically advance the focus to the next text field once its current value filled… this will continue down to all rows.  
I have tried enable domId for each text field with prefix of each row with Step# (Step1\_txt1, Step1\_txt2) and using text Value Change script:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/5/c5f7afbe38b292b47c8872de772f257b261769bc.png)  
I looked through the forum but haven’t found the solutions yet. Best match was: [Please add ids to perspective components for writing tests](https://forum.inductiveautomation.com/t/please-add-ids-to-perspective-components-for-writing-tests/46949)

What would be the best way to make this approach? Thanks everyone!

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [August 31, 2022, 8:51am UTC](https://forum.inductiveautomation.com/t/advance-text-field-components-in-flex-reapeater/63629/2 "2022-08-31T08:51:22Z")

</div>

Does pressing tab not work?

you arent going to get anything done with the driver thing, that is not running on the client. but just on the gateway, used for testing

---

<div class="post-metadata">

**Author:** ![Kiet\_Vo](https://avatars.discourse-cdn.com/v4/letter/k/7ea924/32.png) [@Kiet\_Vo](https://forum.inductiveautomation.com/u/Kiet_Vo)\
**Post date:** [August 31, 2022, 11:08am UTC](https://forum.inductiveautomation.com/t/advance-text-field-components-in-flex-reapeater/63629/3 "2022-08-31T11:08:07Z")

</div>

No keyboard involved but text is entered using scanner.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [August 31, 2022, 1:40pm UTC](https://forum.inductiveautomation.com/t/advance-text-field-components-in-flex-reapeater/63629/4 "2022-08-31T13:40:06Z")

</div>

You can probaly program you scanner to send a tab after a scan

If the scanner is used for somethign else where this would be undesirable

The easiest way is proably working with messages.

1. A scripts in the onChange of the inputfield, that sends its step number/id in a message to the page
2. In the page a message handler that sends a message to the next step
3. a message handler on the inputfield that does a focus if its id matches the one send by the message of step 2

it can also be done with a step less if you use indexs instead of your prefex  
example:

> [@Flex Repeater Focus](https://forum.inductiveautomation.com/t/flex-repeater-focus/53748):
>
> Hello all, I am trying to shift focus to different numeric entry fields in my perspective project. In this example I have 4 fields, two of them sitting inside a flex container and I can auto-advance focus on them using the change script: if currentValue!=previousValue: self.parent.parent.getChild("nok").getChild("nokBC").focus() How can I gain focus on the third field after that? (the third field is the instance of a flex repeater)

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [August 31, 2022, 2:25pm UTC](https://forum.inductiveautomation.com/t/advance-text-field-components-in-flex-reapeater/63629/5 "2022-08-31T14:25:52Z")

</div>

The supplied approach will work, but will require you to bind the `domId` field to an incoming param of the View, which means you’ll also need to supply those params into the instances of the Flex Repeater.

---

<div class="post-metadata">

**Author:** ![Kiet\_Vo](https://avatars.discourse-cdn.com/v4/letter/k/7ea924/32.png) [@Kiet\_Vo](https://forum.inductiveautomation.com/u/Kiet_Vo)\
**Post date:** [September 6, 2022, 1:16pm UTC](https://forum.inductiveautomation.com/t/advance-text-field-components-in-flex-reapeater/63629/6 "2022-09-06T13:16:20Z")

</div>

Thanks everyone for your suggestions… I have successfully made it happened with message handler for the text field…  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/c/6cf6de3d92e65bb05490e9ce9076d8b008ee0a39.png)

then using the Change Script option on Props Text to pass the name of the next component to get focused.
