Function to dynamically enable or disable a binding in perspective using a script similar to component.refreshBinding(‘propertyName’)
This sounds like a bit of an XY problem.
What are you trying to do that would be solved by programatically disabling a binding?
TIL the name of the “XY Problem”. (:
It sounds like you want to modify the data in a binding with a follow up calculation or user editing.
Don’t do it. Instead, create a custom property of the same type, move the binding there, and conditionally use it as the source for the original property, including any follow-up calculations. This lets you block updates while manually editing and lets you transform data before presentation without infinite loops or race conditions.
Dynamically turning on and off bindings programmatically is opening pandoras box and will introduce you to a whole new class of problems and complexity that you most likely do not want.
I have a tag binding (expression) that is dependent on multiple custom properties that in turn is dependent on the view parameters. It works but it spams the logs with The following error
To remove the error I had to change the tag binding to an expression binding and combine if() and tag() to ensure all the cusrom properties have evaluated their bindings before trying to reference the tag.
I am all ears for a better solution.