Template Parameters in Template Repeater

Hi, I have created a template with 20 template parameters and used template repeater to repeat the template for 20 sensors. I need to configure the parameter for each template according to the sensor information. However, I am unable to access the parameter from the template repeater. and would appreciate anyone helps. I need to use template repeater as i need to make a scrollable pop up window so that the pop up window will not cause my main window to resize.

Well, this won’t be the entire answer to your question, but it might help. Let’s say that you have a template like below:

If you then use a template repeater to put that template on the screen in Dataset repeater mode like below:

Within the button (that is outside of the template repeater), you can use a script like below to retrieve parameters from the various template instances within the repeater:

templates = event.source.parent.getComponent('Template Repeater').loadedTemplates

for template in templates:
	print '%s %s' % (template.getPropertyValue('ParamA'), template.getPropertyValue('ParamB')) 

This will produce:

Hello World
Hej Världen

I bet there is a way to use property change listeners to propagate the value changes up and out of the template repeater to drive the actions that you want but it is a bit too late for me to hack that up right now. Hopefully the above provides some useful insight.

Hi Kevin,

Thanks for your help.

I will give it a try if time permit.