Is there any way to trigger a binding AFTER several other bindings on the page?
I have a single binding that does some slightly complex calculations on the inputs, then runs a generated query in a transform and displays the output in a table.
The inputs to the query come from many input components (mostly dropdowns) on the page which themselves are initialized via bindings.
However, at page load, as each binding on the input components is executed, it triggers the binding which generates the query and updates the table, so the query and table gets updated potentially many times. (It seems to be quite random the binding trigger order).
I would like the generated query and table update to execute last on page load so that the table is only initialized once on page load, and then updated when any of the input components change.
Is there anyway to accomplish this? or some other way to go about this?
I did something like this once by having custom properties monitor the loading state of several components.
All my bindings went through a script transform, so I added just one line before returning, that looked like this:
self.view.custom.component_x_loaded = True
And then I had one more property that I called view_loaded and that was bound to all the component_x_loaded.
Then anything that needed to wait for other components to load checked if view_loaded was true before doing any calculation.
Now that was several versions ago, so there might be better mechanisms in place now. But it works.
Using an Expression Structure and “Wait on All” helped significantly, and reduced the number of times the query is triggered on “page load” to two. Still trying to figure that out, but it is much better. It was firing up to 7-8 times previously.