# Power Chart onCellEdited is invoked twice

**URL:** <https://forum.inductiveautomation.com/t/power-chart-oncelledited-is-invoked-twice/10727>\
**Category:** Ignition\
**Created:** [November 3, 2015, 5:23pm UTC](https://forum.inductiveautomation.com/t/power-chart-oncelledited-is-invoked-twice/10727 "2015-11-03T17:23:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rforbes](https://avatars.discourse-cdn.com/v4/letter/r/a88e57/32.png) [@rforbes](https://forum.inductiveautomation.com/u/rforbes)\
**Post date:** [November 3, 2015, 5:23pm UTC](https://forum.inductiveautomation.com/t/power-chart-oncelledited-is-invoked-twice/10727/1 "2015-11-03T17:23:59Z")

</div>

I have implemented an onCellEdited method in PowerChart to validate an entry. I observe that an invalid entry causes the warning dialog comes up twice, causing the user to dismiss two identical dialogs. so it seems onCellEdited is being invoked twice for a single edit…

---

<div class="post-metadata">

**Author:** ![NorthPoint](https://avatars.discourse-cdn.com/v4/letter/n/a88e4f/32.png) [@NorthPoint](https://forum.inductiveautomation.com/u/NorthPoint)\
**Post date:** [March 7, 2016, 12:52pm UTC](https://forum.inductiveautomation.com/t/power-chart-oncelledited-is-invoked-twice/10727/2 "2016-03-07T12:52:09Z")

</div>

Hi all, any update or response to this? I am seeing this behavior too.

---

<div class="post-metadata">

**Author:** ![jimmillereads](https://avatars.discourse-cdn.com/v4/letter/j/90db22/32.png) [@jimmillereads](https://forum.inductiveautomation.com/u/jimmillereads)\
**Post date:** [June 27, 2016, 7:17pm UTC](https://forum.inductiveautomation.com/t/power-chart-oncelledited-is-invoked-twice/10727/3 "2016-06-27T19:17:41Z")

</div>

I am having the exact same problem. Checking newValue != oldValue does not help. Must be getting called twice right up front.

---

<div class="post-metadata">

**Author:** ![JMicky](https://avatars.discourse-cdn.com/v4/letter/j/dfb087/32.png) [@JMicky](https://forum.inductiveautomation.com/u/JMicky)\
**Post date:** [October 31, 2016, 8:15pm UTC](https://forum.inductiveautomation.com/t/power-chart-oncelledited-is-invoked-twice/10727/4 "2016-10-31T20:15:51Z")

</div>

I’m seeing the same issue. Searching got me here but no further.  
I’m using Ignition Version 7.8.1

The onCellEdited is invoked twice only if I open a system.gui.confirm or system.gui.messageBox from the onCellEdited script. My intention was to use a confirm dialog box to show the user the old value and the new value and give the user a chance to cancel the update.

Please respond if there are any work arounds or updates for this.

Thank you,

John

---

<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:** [October 31, 2016, 10:53pm UTC](https://forum.inductiveautomation.com/t/power-chart-oncelledited-is-invoked-twice/10727/5 "2016-10-31T22:53:46Z")

</div>

Unfortunately, this is a problem caused by the way modal popups generated by the system.gui.\* functions interrupt focus. You can use an invokeLater call to get around this issue:

```auto
	def message():
		return system.gui.confirm("message", "title", False)
	
	system.util.invokeLater(message)

```

EDIT: Also, attached is a workaround that keeps the ‘Confirm’ message box functional. I’ll leave putting correct values into the message box an exercise for the reader. Also, this relies on implicit type conversion (because handling the type would be a good deal more work) but this should work for most/all of the common data types (eg, strings, ints, floats, booleans will all work fine with this code).
