Pass parameters between Dock and Primary View

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ā€¦

  1. 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).
  2. 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?
  3. Communication back-and-forth between Views should absolutely be handled wherever possible by using Message Handlers.
2 Likes

Gotcha. There is a lot to get used to.

1 Like