Update template repeater property from template script

So I have a template that contains a button as well as a number of other components. I have a template repeater on a window that then repeats anywhere from 2 - 12 of these templates. Is it possible to set a custom property on the template repeater based on clicking on one of the buttons? I want it to work almost like a simple multi-state button but can’t seem to get anything to work? Just wondering if this is possible and if so how I might go about doing it. Thanks.

I’m sure there is a better way but for now here a solution for you.

On the Template repeater, I set a custom property with the name state. And on the Template containing the button is also a custom property state. In the button action script is this:

    event.source.parent.parent.parent.parent.parent.state = event.source.parent.state

This writes the value of state from the button template to the template repeater.