Template Canvas - Template Parameter/Layout Issue

I am definitely a Perspective guy and am having some issues with Vision’s template canvas.

I need to dynamically change the height of the embedded template when I change its parameter, but I am unable to:

  1. Change the height dynamically on the template, and it render in the canvas as well.
  2. Detect the change in the template parameters from the canvas level in the “Templates” dataset property.

If I initialize the template with the following dataset:

When I change the dropdown value, it bidirectionally changes the parameters on the template, but I am unable to detect that in the Templates dataset:

Note, I also have the templates using layout with “cell 0 0” and “cell 0 1”, but when I change the height of the templates it doesnt seem to reflect that in the canvas.

Edit: I updated this and tried it with the view canvas layout set to “flowy,fill” and each item inside is set to layout “center” as well, works better for what I need but still doesnt fix either of these problems.

Template before value change (Height of 130):

Template after parameter change (Height of 60):

What I can say, is this is greatly growing my appreciation for Perspective and responsive design Hahaha

I really appreciate any help from those more used to Vision than I am!

Keith G.

@nminchin based on your comment on my other post, would you say that this is probably just not possible?*

*in Vision

I haven’t actually used the template canvas much at all, so I can’t really comment sorry. I’d expect what you’re trying to do should work if it’s updating the dataset that drives the canvas

The Template Canvas component will not update the dataset from the template instances inside. You must regenerate it yourself. A template instance inside the canvas can script such an update by climbing the parentage tree of components (not really documented except examples here on the forum).

Ahh, so the components in the template itself will have reference to their parent container (canvas) they are created in? I think with that I could probably write some method on the canvas that updates the specific items parameters and forces a reinitialization? That sounds like the easiest way I can think of

Yes, though there are unnamed layers between. Two of them for canvas and repeater, and one layer for the singleton template instance. Having to send messages in Perspective for sibling views to pass information is one of its few annoyances.

1 Like

So you can’t reference the parents of embedded Views directly in the embedded View definition itself?

Not embedded views, components in containers yes, however being neck deep in perspective I can say this isn’t really needed that often if you design the page correctly.

The perspective “embedded view containers” like the flex-repeater, view canvas, etc. all have access to the views parameters and so you could watch for changes on the child parameters from the parent.

Or you can use message handling and send messages around, so say when you click a button on the embedded view, you send a message called in the scope of the page, and then you have a messageHandler on the view that you want to respond to it.