# Refreshing data on a table

**URL:** <https://forum.inductiveautomation.com/t/refreshing-data-on-a-table/12815>\
**Category:** Archived Topics\
**Created:** [March 20, 2017, 12:57pm UTC](https://forum.inductiveautomation.com/t/refreshing-data-on-a-table/12815 "2017-03-20T12:57:13Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrtweaver](https://avatars.discourse-cdn.com/v4/letter/m/77aa72/32.png) [@mrtweaver](https://forum.inductiveautomation.com/u/mrtweaver)\
**Post date:** [March 20, 2017, 12:57pm UTC](https://forum.inductiveautomation.com/t/refreshing-data-on-a-table/12815/1 "2017-03-20T12:57:13Z")

</div>

Ok so i have this table, i can click on an item, it will select that item, then i can click on edit and a pop up will happen that contains the data from the selected row and column of the table from the previous window. So now at this point i can alter the data and write it back to the database.

But when the popup window closes the data in the table does not automatically refresh.

So my one question is as follows: When the lines of code are executed from a button click event, and during execution it comes to a popup windows, does it execute the popup window and then when the popup window closes resumes execution from where it was?

Or what is the best way to have the table refresh the data one a change has been made?

Thanks

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [March 20, 2017, 2:16pm UTC](https://forum.inductiveautomation.com/t/refreshing-data-on-a-table/12815/2 "2017-03-20T14:16:09Z")

</div>

Hi mrtweaver,

To answer your question, no, execution does not continue when the popup window is closed. An event script that opens a popup window continues to execute right away after the line that opens the popup window.

The exception to this is a modal popup that is shown with such functions as system.gui.inputBox. So what kind of popup window do you mean? An Ignition window that is used as a popup window, or a modal window that is shown because of a function call to system.gui.inputBox?

The best way to update/refreash a table (or any property) programmatically is to use the [system.db.refresh](https://docs.inductiveautomation.com/display/DOC/system.db.refresh) function. You could add a script to the “visionWindowClosed” event of the popup window that gets the window that has the table you want to refresh and refreshes the data property of that table with system.db.refresh.

Best,

---

<div class="post-metadata">

**Author:** ![mrtweaver](https://avatars.discourse-cdn.com/v4/letter/m/77aa72/32.png) [@mrtweaver](https://forum.inductiveautomation.com/u/mrtweaver)\
**Post date:** [March 20, 2017, 4:55pm UTC](https://forum.inductiveautomation.com/t/refreshing-data-on-a-table/12815/3 "2017-03-20T16:55:55Z")

</div>

Ok I think i understand but the one problem i am having is formatting the sentence correctly. Here is what i have.

```auto
table = event.source.getWindow('Test Window').getComponent('standards').getComponent('Customer Table').data
fpmi.db.refresh(table, "data")
```

But that does not work. I know i am missing something though.

Any help appreciated.

Thanks

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [March 20, 2017, 4:59pm UTC](https://forum.inductiveautomation.com/t/refreshing-data-on-a-table/12815/4 "2017-03-20T16:59:24Z")

</div>

Here:

`table = system.gui.getWindow('Test Window').getComponent('standards').getComponent('Customer Table')
system.db.refresh(table, "data")
`Best,

---

<div class="post-metadata">

**Author:** ![mrtweaver](https://avatars.discourse-cdn.com/v4/letter/m/77aa72/32.png) [@mrtweaver](https://forum.inductiveautomation.com/u/mrtweaver)\
**Post date:** [March 20, 2017, 5:25pm UTC](https://forum.inductiveautomation.com/t/refreshing-data-on-a-table/12815/5 "2017-03-20T17:25:15Z")

</div>

Ok first off where is this visionClosed that you speak of in your first posting?

Is it the same thing as internal frame closing?

Or is it more like focus lost?

Either way i tried the script in both of them and it does not like the word system.

> [@](#):
>
> ERROR [ActionAdapter-AWT-EventQueue-0] Error executing script for event:&nbsp;`internalFrameClosed`  
> on component:&nbsp;`alter standards`.  
> Traceback (innermost last):  
> File "event:internalFrameClosed", line 1, in ?  
> NameError: system

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [March 20, 2017, 5:34pm UTC](https://forum.inductiveautomation.com/t/refreshing-data-on-a-table/12815/6 "2017-03-20T17:34:01Z")

</div>

Okay, what version of Ignition are you using? In much older versions of Ignition things are different.

---

<div class="post-metadata">

**Author:** ![mrtweaver](https://avatars.discourse-cdn.com/v4/letter/m/77aa72/32.png) [@mrtweaver](https://forum.inductiveautomation.com/u/mrtweaver)\
**Post date:** [March 20, 2017, 5:45pm UTC](https://forum.inductiveautomation.com/t/refreshing-data-on-a-table/12815/7 "2017-03-20T17:45:44Z")

</div>

Uumm i thought this was the Legacy Products FactoryPMI forum?

Because that is what we are running.

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [March 20, 2017, 8:15pm UTC](https://forum.inductiveautomation.com/t/refreshing-data-on-a-table/12815/8 "2017-03-20T20:15:15Z")

</div>

Hi,

It is but I didn’t notice until now. Try using “fpmi” instead of “system” in the function calls.

And try using the internalFrameClosing event on the window instead of visionWindowClosed.

And consider upgrading to Ignition 😮

Best,

---

<div class="post-metadata">

**Author:** ![mrtweaver](https://avatars.discourse-cdn.com/v4/letter/m/77aa72/32.png) [@mrtweaver](https://forum.inductiveautomation.com/u/mrtweaver)\
**Post date:** [March 21, 2017, 12:20pm UTC](https://forum.inductiveautomation.com/t/refreshing-data-on-a-table/12815/9 "2017-03-21T12:20:59Z")

</div>

I have tried, unsuccessfully so far, to persuade employer to upgrade to ignition, have downloaded demo and imported my project into it and tested it, so i know that it will work but convincing them of parting with the money is not an easy task. So for now will keep with legacy.

As for the code there must be something that is not quite right yet because since i changed the word system to fpmi now i get the error message:

second argument can not be coerced into an int

Oh well just keep plugging away for now.

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [March 21, 2017, 7:25pm UTC](https://forum.inductiveautomation.com/t/refreshing-data-on-a-table/12815/10 "2017-03-21T19:25:56Z")

</div>

Check the user manual for FactoryPMI to see how to use the function.
