# Text Field binded to table.props.data Next and Back buttons

**URL:** <https://forum.inductiveautomation.com/t/text-field-binded-to-table-props-data-next-and-back-buttons/90728>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [May 22, 2024, 9:56am UTC](https://forum.inductiveautomation.com/t/text-field-binded-to-table-props-data-next-and-back-buttons/90728 "2024-05-22T09:56:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alejandro\_Alaco](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alejandro_alaco/32/59849_2.png) [@Alejandro\_Alaco](https://forum.inductiveautomation.com/u/Alejandro_Alaco)\
**Post date:** [May 22, 2024, 9:56am UTC](https://forum.inductiveautomation.com/t/text-field-binded-to-table-props-data-next-and-back-buttons/90728/1 "2024-05-22T09:56:02Z")

</div>

Hi!

In ignition perspective I have a text field binded to a data from a table

.../TablaInventario.props.data[0]['Clase equipo']

so it shows the data from column "Clase equipo" in row 0

I want to add a "next" button so this text field change to next row and show its data  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/e/deab2b846420f8ea29034d19bde5060d13460a20.png)

> 

.../TablaInventario.props.data[1]['Clase equipo']

also a back button  
\<

For now I added expression to the text filed:

```python
try({../TablaInventario.props.data}[{../custom.currentIndex}]['Clase equipo'], "")

```

And this to the next button:

```python
def runAction(self, event):

    totalRows = len(self.getSibling("TablaInventario").props.data)

    if self.view.custom.currentIndex < totalRows - 1:
        self.view.custom.currentIndex += 1

```

and back button:

```python
   if self.view.custom.currentIndex > 0:
        self.view.custom.currentIndex -= 1

```

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 22, 2024, 10:29am UTC](https://forum.inductiveautomation.com/t/text-field-binded-to-table-props-data-next-and-back-buttons/90728/2 "2024-05-22T10:29:11Z")

</div>

1. **Don't offer controls options that don't work.** That means disable the \< if you are at the first row and disable the \> if you are at the last.

2. On the Text Field component create `custom.selectedRow`. Set it to 0.

3. On \< add an expression binding to `enabled`.  
`{../TextField.custom.selectedRow} > 0`

4. On \> add an expression binding to `enabled`.  
`{../TextField.custom.selectedRow} < len({..../TablaInventario.props.data}) - 1`

5. On \< add an **onActionPerformed** script:  
`self.getSibling("TextField").custom.selectedRow -= 1`

6. On \> add an **onActionPerformed** script:  
`self.getSibling("TextField").custom.selectedRow += 1`

7. On the Text Field component `props.text` add an expression binding:  
`{..../TablaInventario.props.data}[{this.custom.selectedRow}]['Clase equipo']`

![Table row to text field](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/5/952ecb1b5bcf62042343f8a0d87ba1b3c1a85ef6.gif)

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [August 14, 2024, 12:19pm UTC](https://forum.inductiveautomation.com/t/text-field-binded-to-table-props-data-next-and-back-buttons/90728/4 "2024-08-14T12:19:18Z")

</div>

> [@Alejandro\_Alaco](#):
>
> {../TextField.custom.selectedRow}

Was this value changing? It would need to be bound to the table's selected row.

Expressions are better than scripts.  
Your solution doesn't seem to disable the buttons. Again, " **Don't offer controls options that don't work.**".

---

<div class="post-metadata">

**Author:** ![Alejandro\_Alaco](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alejandro_alaco/32/59849_2.png) [@Alejandro\_Alaco](https://forum.inductiveautomation.com/u/Alejandro_Alaco)\
**Post date:** [August 14, 2024, 12:25pm UTC](https://forum.inductiveautomation.com/t/text-field-binded-to-table-props-data-next-and-back-buttons/90728/5 "2024-08-14T12:25:50Z")

</div>

Yes I changed that expression {../TextField.custom.selectedRow} to {parent.custom.selectedRow}

I’m making it common across all the text fields I’m using.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/e/8e9891ddd82dcce3cab38de5f793acce05861ae1.png)

my solution doesn´t disable the buttons.

right, I just deleted the post, thanks.
