Template Repeater vs Template Canvas

Ignition version 7.9.13.

In general which would render faster:

  1. template repeater using component visibility to control what the user sees.
  2. template canvas using different templates to control what the user sees.

The dataset structure is identical for each item and there is no need for the special layout features available with the template canvas.

Thanks!

If you actually simplify the different templates used in #2 to minimize their content, I would expect it be faster. Possibly not the first time loaded, though, as each template would be deserialized from the gateway.

Thanks Phil… could you expand on “1st time loaded”?

Templates and windows are project resources. The first time they are used in the Vision client, they are requested from the gateway, which returns their serialized form. This round trip to the gateway takes time. Deserializing to create an instance is entirely done in client memory, so takes hardly any time at all. If all the resources are on hand, the bulk of the time opening a window and creating template instances is spent creating and starting their bindings.

A text box on my template has the property change script below. When the value of the text box changes, it appears as if all the template instances reload. Am I doing something wrong or is this the same bug in Template canvas blinking/refreshing/loading

if event.propertyName == 'text':

	canvas = system.gui.getParentWindow(event).getRootContainer().getComponent('Template Canvas')

	params = system.util.jsonDecode(canvas.templates.getValueAt(event.source.parent.index, 'parameters'))
	
	params['text'] = event.newValue
		
	canvas.templates = system.dataset.setValue(canvas.templates, event.source.parent.index, 'parameters', system.util.jsonEncode(params))

You are changing the templates property of the canvas, so all of the templates must reload. To minimize reloads, don’t pass actual data through the templates dataset. Only pass indirect information that the template can use to get and set the source data itself.

So, back to my original question with a bit more context.

The intent of the template repeater/canvas is to provide an interactive user experience. New instances will be added to the container, the order of the data may change, and the user may enter/edit information presented in the instances. In other words the number and types of instances may change as frequently as the information presented in the instances. Would it be better to use canvas or repeater under these circumstances?

Thanks!

No particular advantage to either. You won’t be able to avoid a complete reload when re-ordering or changing the quantity of templates.