Binding Type Script?
E
Everett Cass
How come there isn't a Script Binding type???
I mean it isn't a huge deal not to have it, because you can just use an expression/property binding that is blank and then add a Transform (Script) and return the value that you need it to, but I just wonder why there isn't an Independent Script binding
Photo Viewer
View photos in a modal
Log In
P
Patrik Vogel
would be great to have script binding with a poll rate.
I would appreciate it even more if script bindings would let us define two scripts as a bidirectional binding. one which is polled and one which only triggers when written to from other sources other than the binding itself.
of cause this can be accomplished with another binding and a script transform combined with a change script. however, this can devolve into a loop rather quickly. I have had several use cases for such a binding and had to "invent the wheel" from scratch each time.
P
Peter Dolberg
My guess is that it's because a script binding by itself would only execute once, the same way it would with a constant expression or blank property with a script transform. Otherwise you'd need to specify when the binding would get updated, such as by specifying a periodic trigger, or listing which properties would trigger the binding.
Using any of the other binding types makes it clear when a binding should re-evaluate, so it's simpler to use one of the other binding types with a script transform.
The major downside to leaving out script bindings is that it's not obvious that users could use one of the other binding types solely as the trigger and use the script transform as the real way to compute the binding value. In fact, I never knew until now that you could leave the property or expression blank. I always used a constant expression (e.g. 0) instead.