# \[Bug 2324\] Error in binding prevents the opening of a window in the designer

**URL:** <https://forum.inductiveautomation.com/t/bug-2324-error-in-binding-prevents-the-opening-of-a-window-in-the-designer/17626>\
**Category:** Ignition\
**Created:** [April 6, 2018, 5:31pm UTC](https://forum.inductiveautomation.com/t/bug-2324-error-in-binding-prevents-the-opening-of-a-window-in-the-designer/17626 "2018-04-06T17:31:50Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![steven.elam](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steven.elam/32/4797_2.png) [@steven.elam](https://forum.inductiveautomation.com/u/steven.elam)\
**Post date:** [April 6, 2018, 5:31pm UTC](https://forum.inductiveautomation.com/t/bug-2324-error-in-binding-prevents-the-opening-of-a-window-in-the-designer/17626/1 "2018-04-06T17:31:50Z")

</div>

I really hope an IA developer is listening because I have run across what looks like a bug in Ignition: When opening a window in the designer, I get a division by zero ArithmeticException and the window DOES NOT OPEN. When opening this window in the client, I get no error and the window opens correctly.

How am I going to investigate the error or implement a workaround if I cannot get the window to open in the designer?

Here are the errors I get in the designer:

```auto
Exception: Error setting property to 'java.awt.Color[r=0,g=0,b=0]' for binding on
Answer View.Root Container.Chart Panel.SingleChart.plotBackground
	caused by ArithmeticException: / by zero

Ignition v7.7.8 (b2016040703)
Java: Oracle Corporation 1.8.0_161

```

```auto
Exception in thread "AWT-EventQueue-2" java.lang.ArithmeticException: / by zero
	at com.inductiveautomation.factorypmi.application.components.chart.easychart.ConstantPenDatasource.createTimeColumn(ConstantPenDatasource.java:123)
	at com.inductiveautomation.factorypmi.application.components.chart.easychart.ConstantPenDatasource.updateData(ConstantPenDatasource.java:107)
	at com.inductiveautomation.factorypmi.application.components.chart.easychart.ConstantPenDatasource.startup(ConstantPenDatasource.java:79)
	at com.inductiveautomation.factorypmi.application.components.PMIEasyChart$EasyChart.startup(PMIEasyChart.java:2264)
	at com.inductiveautomation.factorypmi.application.components.PMIEasyChart$EasyChart.createChartImpl(PMIEasyChart.java:2876)
	at com.inductiveautomation.factorypmi.application.components.chart.PMILineChartPanel.createChart(PMILineChartPanel.java:126)
	at com.inductiveautomation.factorypmi.application.components.PMIEasyChart$ChartUpdater.run(PMIEasyChart.java:715)
	at com.inductiveautomation.ignition.client.util.EDTUtil$ProcessQueue.run(EDTUtil.java:113)
	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$500(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)

```

---

<div class="post-metadata">

**Author:** ![bfuson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfuson/32/4597_2.png) [@bfuson](https://forum.inductiveautomation.com/u/bfuson)\
**Post date:** [April 6, 2018, 6:10pm UTC](https://forum.inductiveautomation.com/t/bug-2324-error-in-binding-prevents-the-opening-of-a-window-in-the-designer/17626/2 "2018-04-06T18:10:01Z")

</div>

I have heard of a similar error in the past, where a project was modified and now the windows can’t be opened again in the Designer. Let me see if I can get my coworker to replicate…

---

<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:** [April 6, 2018, 6:13pm UTC](https://forum.inductiveautomation.com/t/bug-2324-error-in-binding-prevents-the-opening-of-a-window-in-the-designer/17626/3 "2018-04-06T18:13:53Z")

</div>

Without opening the window, right click on it in the designer tree while holding a shift key. That’ll give you the option to “Copy XML To Clipboard”. You can then edit the (rather complex) serializable form of the window to find and fix your binding error. Then use the right-click with shift option to “Set XML From Clipboard” with your attempted fixes.

---

<div class="post-metadata">

**Author:** ![steven.elam](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steven.elam/32/4797_2.png) [@steven.elam](https://forum.inductiveautomation.com/u/steven.elam)\
**Post date:** [April 6, 2018, 6:16pm UTC](https://forum.inductiveautomation.com/t/bug-2324-error-in-binding-prevents-the-opening-of-a-window-in-the-designer/17626/4 "2018-04-06T18:16:21Z")

</div>

I have the exported XML (~90000 lines), but am wary of modifying it myself. Is there someone who could look at it and recommend what I would need to delete to get the window to open in the designer?

---

<div class="post-metadata">

**Author:** ![bfuson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfuson/32/4597_2.png) [@bfuson](https://forum.inductiveautomation.com/u/bfuson)\
**Post date:** [April 6, 2018, 6:23pm UTC](https://forum.inductiveautomation.com/t/bug-2324-error-in-binding-prevents-the-opening-of-a-window-in-the-designer/17626/5 "2018-04-06T18:23:40Z")

</div>

Sure, just attach it here.

---

<div class="post-metadata">

**Author:** ![steven.elam](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steven.elam/32/4797_2.png) [@steven.elam](https://forum.inductiveautomation.com/u/steven.elam)\
**Post date:** [April 6, 2018, 6:48pm UTC](https://forum.inductiveautomation.com/t/bug-2324-error-in-binding-prevents-the-opening-of-a-window-in-the-designer/17626/6 "2018-04-06T18:48:01Z")

</div>

Uploading the 90000 lines overwhelmed my browser. Is there an email address I can send it to?

---

<div class="post-metadata">

**Author:** ![bfuson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfuson/32/4597_2.png) [@bfuson](https://forum.inductiveautomation.com/u/bfuson)\
**Post date:** [April 6, 2018, 6:55pm UTC](https://forum.inductiveautomation.com/t/bug-2324-error-in-binding-prevents-the-opening-of-a-window-in-the-designer/17626/7 "2018-04-06T18:55:41Z")

</div>

Sure, let me just PM you

---

<div class="post-metadata">

**Author:** ![bfuson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfuson/32/4597_2.png) [@bfuson](https://forum.inductiveautomation.com/u/bfuson)\
**Post date:** [April 6, 2018, 7:32pm UTC](https://forum.inductiveautomation.com/t/bug-2324-error-in-binding-prevents-the-opening-of-a-window-in-the-designer/17626/8 "2018-04-06T19:32:02Z")

</div>

[AnswerView.zip](https://us1.discourse-cdn.com/inductiveautomation/original/2X/4/4f985e74bc0b9d7099fabd7171c636eca49dfb90.zip) (535.2 KB)

Try this:

1. open document in a text editor
2. select all
3. copy
4. shift+right click on the window in the project browser in the designer
5. Click “Set XML from Clipboard”

Let me know if it works for you.

---

<div class="post-metadata">

**Author:** ![kcabatic](https://avatars.discourse-cdn.com/v4/letter/k/b19c9b/32.png) [@kcabatic](https://forum.inductiveautomation.com/u/kcabatic)\
**Post date:** [April 6, 2018, 7:39pm UTC](https://forum.inductiveautomation.com/t/bug-2324-error-in-binding-prevents-the-opening-of-a-window-in-the-designer/17626/9 "2018-04-06T19:39:39Z")

</div>

If it was recent change to window that caused error. You can try rolling back to earlier version where it were if opens in designer correctly. (i think designer can go back 10 revisions)

---

<div class="post-metadata">

**Author:** ![steven.elam](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steven.elam/32/4797_2.png) [@steven.elam](https://forum.inductiveautomation.com/u/steven.elam)\
**Post date:** [April 6, 2018, 8:48pm UTC](https://forum.inductiveautomation.com/t/bug-2324-error-in-binding-prevents-the-opening-of-a-window-in-the-designer/17626/10 "2018-04-06T20:48:52Z")

</div>

The AnswerView.zip file in your reply contains XML that is identical to what I sent you. Is that what you intended?

After using it to Set XML from clipboard and then attempting to open the window results in the same error and the window does not open.

---

<div class="post-metadata">

**Author:** ![steven.elam](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steven.elam/32/4797_2.png) [@steven.elam](https://forum.inductiveautomation.com/u/steven.elam)\
**Post date:** [April 6, 2018, 10:01pm UTC](https://forum.inductiveautomation.com/t/bug-2324-error-in-binding-prevents-the-opening-of-a-window-in-the-designer/17626/11 "2018-04-06T22:01:07Z")

</div>

After looking in the designer console, I noticed that the first error to appear is as follows:

```auto
ERROR [AbstractPropertyAdapter-AWT-EventQueue-2] 
java.lang.Exception: Error setting property to 'java.awt.Color[r=0,g=0,b=0]' for binding on
Answer View.Root Container.Chart Panel.SingleChart.plotBackground
	at com.inductiveautomation.factorypmi.application.binding.AbstractPropertyAdapter.updateTarget(AbstractPropertyAdapter.java:329)
	at com.inductiveautomation.factorypmi.application.binding.AbstractPropertyAdapter.updateValue(AbstractPropertyAdapter.java:266)
	at com.inductiveautomation.factorypmi.application.binding.ExpressionPropertyAdapter.runExpression(ExpressionPropertyAdapter.java:88)
	at com.inductiveautomation.factorypmi.application.binding.ExpressionPropertyAdapter.startup(ExpressionPropertyAdapter.java:112)
	at com.inductiveautomation.factorypmi.application.binding.DefaultInteractionController.startupAdapters(DefaultInteractionController.java:313)
	at com.inductiveautomation.factorypmi.application.FPMIWindow.startup(FPMIWindow.java:342)
	at com.inductiveautomation.factorypmi.designer.workspace.WindowWorkspace$DesigntimeWindowOpener.openWindow(WindowWorkspace.java:3540)
	at com.inductiveautomation.factorypmi.designer.workspace.WindowWorkspace.openWindow(WindowWorkspace.java:1305)
	at com.inductiveautomation.factorypmi.designer.model.navtree.WindowNode.onDoubleClick(WindowNode.java:248)
	at com.inductiveautomation.ignition.designer.navtree.NavTreePanel$MouseListener$1.run(NavTreePanel.java:598)
	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$500(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.ArithmeticException: / by zero
	at com.inductiveautomation.factorypmi.application.components.chart.easychart.ConstantPenDatasource.createTimeColumn(ConstantPenDatasource.java:123)
	at com.inductiveautomation.factorypmi.application.components.chart.easychart.ConstantPenDatasource.updateData(ConstantPenDatasource.java:107)
	at com.inductiveautomation.factorypmi.application.components.chart.easychart.ConstantPenDatasource.startup(ConstantPenDatasource.java:79)
	at com.inductiveautomation.factorypmi.application.components.PMIEasyChart$EasyChart.startup(PMIEasyChart.java:2264)
	at com.inductiveautomation.factorypmi.application.components.PMIEasyChart$EasyChart.createChartImpl(PMIEasyChart.java:2876)
	at com.inductiveautomation.factorypmi.application.components.chart.PMILineChartPanel.createChart(PMILineChartPanel.java:126)
	at com.inductiveautomation.factorypmi.application.components.chart.PMILineChartPanel.setPlotBackground(PMILineChartPanel.java:333)
	at com.inductiveautomation.factorypmi.application.components.PMIEasyChart.setPlotBackground(PMIEasyChart.java:1191)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.inductiveautomation.factorypmi.application.binding.AbstractPropertyAdapter.updateTarget(AbstractPropertyAdapter.java:322)
	... 23 more

```

---

<div class="post-metadata">

**Author:** ![steven.elam](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steven.elam/32/4797_2.png) [@steven.elam](https://forum.inductiveautomation.com/u/steven.elam)\
**Post date:** [April 6, 2018, 10:06pm UTC](https://forum.inductiveautomation.com/t/bug-2324-error-in-binding-prevents-the-opening-of-a-window-in-the-designer/17626/12 "2018-04-06T22:06:14Z")

</div>

I wonder if editing the XML to remove the binding on Answer View.Root Container.Chart Panel.SingleChart.plotBackground would allow the window to open in the designer? If so, could someone show me how to alter the above XML?

Thanks. I’m really stuck here.

---

<div class="post-metadata">

**Author:** ![bfuson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfuson/32/4597_2.png) [@bfuson](https://forum.inductiveautomation.com/u/bfuson)\
**Post date:** [April 6, 2018, 10:06pm UTC](https://forum.inductiveautomation.com/t/bug-2324-error-in-binding-prevents-the-opening-of-a-window-in-the-designer/17626/13 "2018-04-06T22:06:44Z")

</div>

I made one slight change in the file where I thought you were pulling the users custom configured plotBackground preference and setting it to the component property. I just changed it to a static color(77, 77, 77). You can search for that and see the change between the two files. I will try to look again later.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [April 6, 2018, 10:10pm UTC](https://forum.inductiveautomation.com/t/bug-2324-error-in-binding-prevents-the-opening-of-a-window-in-the-designer/17626/14 "2018-04-06T22:10:40Z")

</div>

Wow, this window is really a poster child for why we stopped serializing most datasets.

Anyhow, removing the binding on the plotBackground should fix it - it’s getting into a situation where it’s trying to use the width of the chart as the horizontal resolution - but the chart is width zero for some reason. I’m surprised nobody has hit this before.

I’m walking into a meeting but I can take a look when I get out.

---

<div class="post-metadata">

**Author:** ![steven.elam](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steven.elam/32/4797_2.png) [@steven.elam](https://forum.inductiveautomation.com/u/steven.elam)\
**Post date:** [April 6, 2018, 10:10pm UTC](https://forum.inductiveautomation.com/t/bug-2324-error-in-binding-prevents-the-opening-of-a-window-in-the-designer/17626/15 "2018-04-06T22:10:41Z")

</div>

I cannot find color(77, 77, 77) anywhere in the attached XML. Did you accidently attach the original XML?

---

<div class="post-metadata">

**Author:** ![Paul.Scott](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul.scott/32/4578_2.png) [@Paul.Scott](https://forum.inductiveautomation.com/u/Paul.Scott)\
**Post date:** [April 6, 2018, 10:29pm UTC](https://forum.inductiveautomation.com/t/bug-2324-error-in-binding-prevents-the-opening-of-a-window-in-the-designer/17626/16 "2018-04-06T22:29:57Z")

</div>

[replacedExpression.zip](https://us1.discourse-cdn.com/inductiveautomation/original/2X/0/0fe4136c7c0abd8085620cdedff6ce7d9e463c60.zip) (383.0 KB)

Try this guy instead. Same instructions as @bfuson stated. You should be able to verify the new file by searching for `color(22,22,22)`

Side note, it looks like the binding was orignally being populated by `app.ctrl.getChartBackgroundColor()`, so you could alternativly hardcode that function to return a static color, open the window, and manually set the property.

Regardless, looks like the app script may be the item giving you grief right now.

---

<div class="post-metadata">

**Author:** ![steven.elam](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steven.elam/32/4797_2.png) [@steven.elam](https://forum.inductiveautomation.com/u/steven.elam)\
**Post date:** [April 6, 2018, 10:37pm UTC](https://forum.inductiveautomation.com/t/bug-2324-error-in-binding-prevents-the-opening-of-a-window-in-the-designer/17626/17 "2018-04-06T22:37:29Z")

</div>

I’ve already tried hardcoding app.ctrl.getChartBackgroundColor() without success.

---

<div class="post-metadata">

**Author:** ![steven.elam](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steven.elam/32/4797_2.png) [@steven.elam](https://forum.inductiveautomation.com/u/steven.elam)\
**Post date:** [April 6, 2018, 10:48pm UTC](https://forum.inductiveautomation.com/t/bug-2324-error-in-binding-prevents-the-opening-of-a-window-in-the-designer/17626/18 "2018-04-06T22:48:00Z")

</div>

Using the XML in replacedExpression.zip results in the same error on window open in the designer. Funny though that it doesn’t refer to color(22,22,22) in the error:

```auto
ERROR [AbstractPropertyAdapter-AWT-EventQueue-2] 
java.lang.Exception: Error setting property to 'java.awt.Color[r=0,g=0,b=0]' for binding on
Answer View.Root Container.Chart Panel.SingleChart.plotBackground
	at com.inductiveautomation.factorypmi.application.binding.AbstractPropertyAdapter.updateTarget(AbstractPropertyAdapter.java:329)
	at com.inductiveautomation.factorypmi.application.binding.AbstractPropertyAdapter.updateValue(AbstractPropertyAdapter.java:266)
	at com.inductiveautomation.factorypmi.application.binding.ExpressionPropertyAdapter.runExpression(ExpressionPropertyAdapter.java:88)

```

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [April 6, 2018, 11:29pm UTC](https://forum.inductiveautomation.com/t/bug-2324-error-in-binding-prevents-the-opening-of-a-window-in-the-designer/17626/19 "2018-04-06T23:29:27Z")

</div>

I would try getting rid of that whole binding. See the line that says:  
`<o-c m="setPropertyName" s="1;str"><str id="481">plotBackground</str></o-c>`

and then 3 lines up from there it says `<o-c m="put" s="2;O;O">`

delete that whole element. Should be about 35 lines.

---

<div class="post-metadata">

**Author:** ![steven.elam](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steven.elam/32/4797_2.png) [@steven.elam](https://forum.inductiveautomation.com/u/steven.elam)\
**Post date:** [April 6, 2018, 11:41pm UTC](https://forum.inductiveautomation.com/t/bug-2324-error-in-binding-prevents-the-opening-of-a-window-in-the-designer/17626/20 "2018-04-06T23:41:45Z")

</div>

Yes! That did it. I was about to try that, but was afraid to remove so many lines. Thanks for the tip.

It would be nice to know if there is a bug, or if I introduced some circular logic of some kind to cause this (so I won’t do it again in the future).

The reason for the plotBackground binding was as a solution to the problem I encountered in [this post](http://forum.inductiveautomation.com/t/easychart-configurechart-extension-function/17300).

[Next page](https://forum.inductiveautomation.com/t/bug-2324-error-in-binding-prevents-the-opening-of-a-window-in-the-designer/17626.md?page=2)
