Query Binding Ondemand Only

I've got a perspective application that has a table that allows the user to pull data from a database over a different number of selection criteria. There is a custom property on the view that has a Query Binding and I'm passing in that selection criteria.

Is there any way to 100% control the execution of that Query Binding? I don't want the binding to execute on view startup etc... until I issue a refreshBinding onto that property.

I'm thinking that the only way to do this is with a script in the background, I just want to make sure before I re-work things to go that route.

Any ideas?

Sounds like you just want to run a named query in a button or other method using the script system.db.runNamedQuery?

2 Likes

In Vision I can control the execution of bindings to a point. So I was hoping there was something similar with a Perspective Query binding.

Ultimately I'm probably going to have to script it, it'll just take a bit on this system to go through everything and I was hoping to keep the bindings like I have them to keep the work to a minimum.

https://docs.inductiveautomation.com/display/DOC81/Perspective+Component+Methods#PerspectiveComponentMethods-RefreshingBindings

If any of the selection criteria change you can issue a refreshBinding although you mention that in your post so I am not sure if you mean something else.

Saw a recent post asking similar and they mentioned there is no debouncing going on with a NQ binding that has other values fed into the parameters, so if someone changes one filter criteria - that runs the NQ. Then they change the next criteria - that reruns the NQ, even if its 1/10 of a second later. The only way here to have complete control is with scripting I think.

That is exactly the issue I'm having. Changing one parameter issues a refresh even if both are changed via scripting.

So I'll start working on doing things via scripting.

2 Likes