Is there any way to turn property bindings on and off?

I currently have a chart objects Unit Count property set to an expression that calculates the run time of a product so the chart constantly stretches out to display the entire dataset. I would like to have a checkbox to turn this feature on and off so the user can still manually enter a Unit Count value without the property binding overwriting it.

I tried to set the Unit Count property to my expression via the event script of my checkbox but it tries to convet my string to an integer.

You can’t turn a property binding on or off. In order for a user to change the property and have it stick, the binding cannot fire or change the property.

What I would do is add a timer component to the window from the misc tab. Bind the running property of the timer to the checkbox. Set the timer to run as fast or as slow as you want. When the timer executes you can set the unit count to the the value from the expression you already have. When the checkbox is unchecked the timer will no longer execute, allowing the user to override the value.

So, add a dynamic property to the root container that is bound to the same expression you have on the unit count property. Remove the binding on the unit count property. Add the following actionPerformed event script on the timer:event.source.parent.getComponent("Chart").unitCount = event.source.parent.unitCountLet us know if you have any further questions.