Write to a child template from a template repeater level

Hi Inductive World,

I'm trying to take a 'template repeater' parameter value and write to one of the template parameters (on the child template). This is the script I have to get the components of the template.

repeater = event.source.parent.getComponent('Template Repeater')
loadedTemplates = repeater.getLoadedTemplates()
for temp in loadedTemplates:
	y = temp.getComponent('rowCountTempParam')
	print y
	valueToWrite = event.source.rowCount
	if y is not None:	
		x = y.setParameter('rowCountTempParam', valueToWrite)

I'm able to access the child template component 'rowCountTempParam' from the outside layer but it shows up as 'none' and can't write to it. Any help is appreciated!

See this post, and note how I handle accessing the template's custom properties:

update-row-in-template-repeater-using-button-outside-from-template-click

Also, in case your running into the pycomponent wrapper issue, see this post for a way around that:
why-cant-custom-properties-and-methods-be-accessed-from-a-component-that-is-obtained-using-swingutilities-getancestorofclass

Thank you so much @justinedwards.jle . I was able to use the dynamicProps and setPropertyValue() function to achieve this.

1 Like