Passing custom property through different views-perspective

Hi, I have a custom property in a view with value getting from datetime input component, I want to pass this live value to the custom property on another view. I am wondering how could I do it? thanks!

It depends on the relation of the two Views.

A. View2 is Embedded View within View1, OR View2 is a Popup opened by View1:
Pass the property value as a param to the Embedded View/Popup.

B. View2 is on a different Perspective Page than View1:
Bidirectionally bind the custom property on View1 to a custom session property. Bind the custom property on View2 to the same custom session property.

C. View2 is a Docked View of the Perspective Page which contains View1:
You could still use the session property route, or you could use system.perspective.sendMessage() docs as part of a change script on the custom property to broadcast value updates. This would also require a Message Handler be put in place on View2 to listen for the broadcasts.

If you provide a better idea of how the Views will be used, I might be able to help a bit more.

1 Like

hello, view 2 will be embedded in view1 by passing parameters and dropconfig,udts. Could you please explain more how i can pass the custom property in view1 to view2. Thanks

Assuming you set up a param on View2 with a key of param_name, then you would create a new property in the EmbeddedView.props.params object with a matching key of `param_name, like so:
Screen Shot 2020-09-03 at 2.29.36PM

Secondly, bind that value against View1.custom.myCustomProp, like so:

Finally, within View2, make sure that you do indeed have the param in place and configured as an “Input”, like so:


Note that in this screenshot the param is using a default “fallback” value. It will use this value in the Designer, but during runtime that param will receive the value from the View1 view. You can change the default value to be anything you’d like, just know it will be replaced at runtime by whatever View1 supplies.

1 Like

hello, I am not sure if I make myself clear. My view 2 is a view that will be embedded into view 1 though drag-and-drop the udts. So view 2 pretty much is a template for all embedded views that are going to be dragged and dropped into view 1. I am think if I could pass a component property or a view custom property into view 2 (the template). Is this scenario still fall into A. View2 is Embedded View within View1 ? thanks!