Template repeater with UDT templates

I have a template with a template parameter of custom UDT type.
Now, i want to use the template repeater to create 4 instances of this template.

I use dataset mode on the repeater component. I want to reference 4 separate UDT instances as parameters.

The name of the template parameter is TankUDT.
I now create a template parameter dataset on the repeater component with a column named TankUDT of type string.
At each line i punch in the tagpath of the UDT instance.

This does not work. How can i reference a UDT instance in a dataset?

You can't. You need a parameter in your template that receives your tag path as a string. Within the template, use an indirect tag binding to retrieve the correct UDT based on that string.

2 Likes

I ran into this before where I had a template with a UDT parameter, but also wanted to render it in a repeater. To make that possible, I just made a wrapper template with a string parameter for a tag path. Inside the wrapper template, I mapped the UDT at the path to the original templates parameter. In your repeater you just use the wrapper instead and pass the tag paths.

5 Likes

This is exactly what I need to do for my project, but am having a hard time following the two suggestions above. I’m very familiar with the many concepts in Vision, but just got into template repeaters recently.

In my template, do I need an internal property or template parameter for the path string? I would assume an internal property, because that’s the only way I can bind or “map” something, since you can’t bind a template parameter either on the template or in a repeater directly, no? Lastly, what are you binding, can an example be shown?

2 Likes