Pass full component via params with an embedded view

Good morning,

is possible to pass a component (in my case a perspective table) via params?

I need to do this because I have this table in an embedded view and and outside I have an export button with a function that take the full table component so to manage the properties. Fo example if I call the table in this way it works

table = self.parent.parent.getChild("FlexTable").getChild("myTable")

I try to add an output parameter bind with

return self.getChild("root").getChild("FlexTable").getChild("Table")

but is not working, I have as return com.inductiveautomation.perspective.gateway.script.ComponentModelScriptWrapper$SafetyWrapper@2c0cb8d6

Don't believe you can take the entire table.. but you could take all of say, .props

2 Likes

Thanks for the answer, with .props is not working.

I make it works using a Message Handler :+1:

Technically I’ll mention that it is possible, though passing the entire tables data is probably unwise and going to to cause you grief so message handlers is the proper way to go about this. But I thought I’d add this as if it’s a small bit of info like a selected line, you could just pass that.

You could use an onchange script on the table.props.data to write props.data to a parameter called dataOut set as an output. Then in the parent view reference that parameter via embeddedview.props.params.dataOut and have it for your export button.