Is it possible to pass data from a docked view to the primary view? Other than with session parameters, that is.
That’s essentially what the ‘Params’ custom properties of a view is for: Known public properties that will affect something in the view when changed. Of course, you can change a property at any level or grovel inside the view and call a custom method on one of its components, since everything is public by default, but that way lies madness.
Hopefully views will also gain public methods; that would be a lot cleaner and more natural than directly changing properties.
Edit: It looks like you can access the custom methods on a view via the menu bar, Component->Configure Scripts, even though they don’t show in the right-click menu.
I just stumbled across this page that describes Message Handling as the preferred solution to this exact problem: https://docs.inductiveautomation.com/display/DOC80/Component+Message+Handlers
Thank you silverbacknet. I tried to get the parameters to work on the dock setup, but it is less than obvious how they should be used- since they allow you to just type in a name, and there is no binding in either window, I kind of assumed that the name you typed in there would have to exist on both the primary and dock views, but that didn’t seem to work (though I was not willing to go through the various permutations). I saw the bit about the messages too, and I guess that is the way to go. I’ve not tried them yet.
Okay, so there are several things going on in this conversation, and it sounds like there’s a bit of confusion as well…
- Docked View parameters are terrible right now, but we’re working on it. Probably not 8.0, but 8.0.1 for sure (I believe the changes barely missed the cut-off).
- Parameters can be used to send data back-and-forth, but they shouldn’t be used that way in 99% of cases. Parameters should be used just as in coding, in that you supply them at the start and the method/builder/class (View) uses them to do something. While you could have a “return” of sorts, what would you return after “building” a View?
- Communication back-and-forth between Views should absolutely be handled wherever possible by using Message Handlers.
Gotcha. There is a lot to get used to.