# How to change visibility during a event script to hide the table that is updating?

**URL:** <https://forum.inductiveautomation.com/t/how-to-change-visibility-during-a-event-script-to-hide-the-table-that-is-updating/112875>\
**Category:** Ignition\
**Tags:** scripting, vision\
**Created:** [December 17, 2025, 9:05pm UTC](https://forum.inductiveautomation.com/t/how-to-change-visibility-during-a-event-script-to-hide-the-table-that-is-updating/112875 "2025-12-17T21:05:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gjweitzel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gjweitzel/32/54596_2.png) [@gjweitzel](https://forum.inductiveautomation.com/u/gjweitzel)\
**Post date:** [December 17, 2025, 9:05pm UTC](https://forum.inductiveautomation.com/t/how-to-change-visibility-during-a-event-script-to-hide-the-table-that-is-updating/112875/1 "2025-12-17T21:05:13Z")

</div>

I’m using an event scrip to update a table from opc tags, with browse. The browse and read takes a few seconds, in that time the table is out of date. I tried to fill the table with an empty header and data, and I’ve tried covering it with a label.

```python
if event.propertyName == "path":
    import system, time, mfg_IgnitionLib as tb
    
    Updating = event.source.getComponent('Updating')
    Updating.visible = True
    ####### Start    
    start = time.time()            
    
    opcServer = "TcOpcUaServer@Factory1"
    rootOPCPath = event.source.path
    ConfigTagTable = event.source.getComponent('Configuration Tags')
    ConfigTagTable.data = tb.getTableData(opcServer, tb.browseCfg(opcServer,rootOPCPath,0,1))
    Updating.visible = False
    #results = writeOPCfromTable(opcServer, rootOPCPath, ConfigTagTable.data)
    tb.logger.info('Read OPC Complete : { "totalTime" : "%s"}' %(time.time() - start))

```

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [December 17, 2025, 9:18pm UTC](https://forum.inductiveautomation.com/t/how-to-change-visibility-during-a-event-script-to-hide-the-table-that-is-updating/112875/2 "2025-12-17T21:18:11Z")

</div>

You can move long running tasks you want to do to an asynchronous thread, using `system.util.invokeAsynchronous`.

Note the caution at the top of the manual, which I'll repeat here:

# Caution

> This function should not be used to asynchronously interacts with the GUI in Vision. This means interacting with window navigation, setting and getting component properties, showing error/message popups, and really any other methods that can interact with components and windows. If you need to do something with the GUI in Vision with this function, this must be achieved through a subsequent call to [system.util.invokeLater](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-util/system-util-invokeLater).

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 17, 2025, 9:26pm UTC](https://forum.inductiveautomation.com/t/how-to-change-visibility-during-a-event-script-to-hide-the-table-that-is-updating/112875/3 "2025-12-17T21:26:46Z")

</div>

A bit of clarification:

Your event script runs in the foreground, and Java Swing is single threaded for all component updates. Which means your attempts to hide or alter a component will not be **drawn** until you give up the CPU (finish your event script).

Long old thread here, but still valid:

> [@Update GUI via Asynchronous thread](https://forum.inductiveautomation.com/t/update-gui-via-asynchronous-thread/9666):
>
> I’ve got a script I am experimenting with that can take a lot of time to execute, so I now use the system.util.invokeAsynchronous to run the script in a separate thread to keep the GUI from locking up. I am using the asynchronous thread to copy files from one place to another, and I would like to show the progress of the file copy with a progress bar. How would I go about this? I am importing a few python libraries to do this. import shutil def fileTransfer(): path = system.file.openFile() …

---

<div class="post-metadata">

**Author:** ![gjweitzel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gjweitzel/32/54596_2.png) [@gjweitzel](https://forum.inductiveautomation.com/u/gjweitzel)\
**Post date:** [December 18, 2025, 3:18pm UTC](https://forum.inductiveautomation.com/t/how-to-change-visibility-during-a-event-script-to-hide-the-table-that-is-updating/112875/4 "2025-12-18T15:18:13Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [December 18, 2025, 3:30pm UTC](https://forum.inductiveautomation.com/t/how-to-change-visibility-during-a-event-script-to-hide-the-table-that-is-updating/112875/5 "2025-12-18T15:30:52Z")

</div>

Little clean up note on your script - you never need to import `system` and you never _should_ import your own library scripts - it can cause caching issues.

---

<div class="post-metadata">

**Author:** ![Nol](https://avatars.discourse-cdn.com/v4/letter/n/8e8cbc/32.png) [@Nol](https://forum.inductiveautomation.com/u/Nol)\
**Post date:** [December 18, 2025, 5:57pm UTC](https://forum.inductiveautomation.com/t/how-to-change-visibility-during-a-event-script-to-hide-the-table-that-is-updating/112875/6 "2025-12-18T17:57:01Z")

</div>

It sounds like you have a browse button that they click and then it updates the table? You could have the browse button first have an event to enable the visibility of a loading message then at the end of your script revert said visibility setting. One option for a work around rather than doing it mid script.
