# Refresh Power Table Extension Functions

**URL:** <https://forum.inductiveautomation.com/t/refresh-power-table-extension-functions/11468>\
**Category:** Ignition\
**Created:** [April 5, 2016, 3:41pm UTC](https://forum.inductiveautomation.com/t/refresh-power-table-extension-functions/11468 "2016-04-05T15:41:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ray.crowder](https://avatars.discourse-cdn.com/v4/letter/r/e480ec/32.png) [@ray.crowder](https://forum.inductiveautomation.com/u/ray.crowder)\
**Post date:** [April 5, 2016, 3:41pm UTC](https://forum.inductiveautomation.com/t/refresh-power-table-extension-functions/11468/1 "2016-04-05T15:41:42Z")

</div>

Hi All,

See screen shot for clarity on layout and functionality. The problem is described below the image.

[attachment=0]powertable.JPG[/attachment]

I am using a power table’s configureCell extension function to do condition formatting much like what is available in excel. The code is solid and works as desired.

The issue that I am having occurs when you switch the signal via the tab strip. The conditional formatting will change to the wrong color, but if you scroll down and then back up the right color is displayed.

Is there a way to refresh the Java renderer that drives the individual cell color? I tried to refresh the dataset using system.db.refresh, but it did not do what I need it to.

Thanks for any insight!

---

<div class="post-metadata">

**Author:** ![ray.crowder](https://avatars.discourse-cdn.com/v4/letter/r/e480ec/32.png) [@ray.crowder](https://forum.inductiveautomation.com/u/ray.crowder)\
**Post date:** [April 6, 2016, 11:26am UTC](https://forum.inductiveautomation.com/t/refresh-power-table-extension-functions/11468/2 "2016-04-06T11:26:09Z")

</div>

Okay, I figured out a fix. If you feel its not pretty enough, then please let me know as I am always willing to expand my skills.

I used the javax.swing.table repaint() function. You can place it on the property change event handler of the power table. You call it by accessing the component via event.source.parent.getComponent(‘Power Table’).repaint().

Please correct me if I am wrong. My understanding is that it forces java to re-render the table every time a table property changes.

---

<div class="post-metadata">

**Author:** ![petr.sasin](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@petr.sasin](https://forum.inductiveautomation.com/u/petr.sasin)\
**Post date:** [December 9, 2021, 8:00am UTC](https://forum.inductiveautomation.com/t/refresh-power-table-extension-functions/11468/3 "2021-12-09T08:00:53Z")

</div>

You can make it even more simple and more general by call **event.source.repaint()**

In my case power table need to be repaint only when data are changed so I call it like this in _propertyChange_ script of Power Table:

```auto
if event.propertyName == "data" :
	event.source.repaint()

```

I’m using Ignition 7.9

---

<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 9, 2021, 2:03pm UTC](https://forum.inductiveautomation.com/t/refresh-power-table-extension-functions/11468/4 "2021-12-09T14:03:19Z")

</div>

You’re referring to the same method. Ray was accessing it from a sibling tab strip that contributed to the coloring of the table. Your method only applies to table data changes, but is superfluous because table data changes cause the repaint anyways. The OP wanted a repaint when the table data **wasn’t** changing.
