Get TemplateRepeater object from within repeated template component

The template that I’m repeating is able to delete its entry from the SQL table that’s providing the Template Repeater dataset, so upon deleting it, I want to also trigger the templateParams dataset to refresh.

I have tried to get the containing Template Repeater component from the Template by using:

# assuming event.source.parent is the Template root container, go back one level
templateRepeater = event.source.parent.parent

However this returns this object:
com.inductiveautomation.factorypmi.application.components.TemplateRepeater$VerticalView

Three questions:

  1. what does the $ mean in that object? I presume it means that VerticalView is a child component of the TemplateRepeater?
  2. how can I get a reference to the TemplateRepeater object from ...TemplateRepeater$VerticalView?
  3. what is the best way to get a reference to the TemplateRepeater object from the Template? (may be the same answer as (2))

You gotta go higher up.

event.source.parent.parent.parent.parent.parent.PropertyOnTheTemplateRepeater

Another option is to refresh the template repeater dataset based on a client tag. Then inside the template whenever you need to refresh, update the client tag.

1 Like