# Passing value from child template to parent template

**URL:** <https://forum.inductiveautomation.com/t/passing-value-from-child-template-to-parent-template/11417>\
**Category:** Ignition\
**Created:** [March 25, 2016, 10:21pm UTC](https://forum.inductiveautomation.com/t/passing-value-from-child-template-to-parent-template/11417 "2016-03-25T22:21:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmisztur2](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmisztur2/32/4243_2.png) [@cmisztur2](https://forum.inductiveautomation.com/u/cmisztur2)\
**Post date:** [March 25, 2016, 10:21pm UTC](https://forum.inductiveautomation.com/t/passing-value-from-child-template-to-parent-template/11417/1 "2016-03-25T22:21:19Z")

</div>

I created a template with a repeater.  
Inside this template will be templated toggle buttons.

I want to notify the parent template with repeater when any of the templated toggle buttons gets selected or deselected.

How can I achieve this?

Thanks

---

<div class="post-metadata">

**Author:** ![cmisztur2](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmisztur2/32/4243_2.png) [@cmisztur2](https://forum.inductiveautomation.com/u/cmisztur2)\
**Post date:** [March 25, 2016, 11:01pm UTC](https://forum.inductiveautomation.com/t/passing-value-from-child-template-to-parent-template/11417/2 "2016-03-25T23:01:17Z")

</div>

lol…

toggle button click \>

```auto
event.source.parent.parent.parent.parent.parent.parent.SomeCustomMethodOnParentTemplate()
```

```auto
print event.source
	print event.source.parent
	print event.source.parent.parent
	print event.source.parent.parent.parent
	print event.source.parent.parent.parent.parent
	print event.source.parent.parent.parent.parent.parent
	print event.source.parent.parent.parent.parent.parent.parent
	print event.source.parent.parent.parent.parent.parent.parent.parent
	print event.source.parent.parent.parent.parent.parent.parent.parent.parent
	print event.source.parent.parent.parent.parent.parent.parent.parent.parent.parent
	print event.source.parent.parent.parent.parent.parent.parent.parent.parent.parent.parent
	print event.source.parent.parent.parent.parent.parent.parent.parent.parent.parent.parent.parent
	print event.source.parent.parent.parent.parent.parent.parent.parent.parent.parent.parent.parent.parent
```

```auto
1:
com.inductiveautomation.factorypmi.application.components.PMIToggleButton[button,0,0,124x85,alignmentX=0.0,alignmentY=0.5,border=,flags=16777512,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=3,left=14,bottom=3,right=14],paintBorder=false,paintFocus=true,pressedIcon=,rolloverEnabled=false,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=Job]
2:
ToggleStripButton
3:
com.inductiveautomation.factorypmi.application.components.TemplateRepeater$VerticalView[,0,0,124x346,layout=net.miginfocom.swing.MigLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777217,maximumSize=,minimumSize=,preferredSize=] 
4:
javax.swing.JViewport[,0,0,124x768,layout=javax.swing.ViewportLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=25165824,maximumSize=,minimumSize=,preferredSize=,isViewSizeSet=true,lastPaintPosition=java.awt.Point[x=0,y=0],scrollUnderway=false]
5:
com.inductiveautomation.factorypmi.application.components.TemplateRepeater$1[,0,0,124x768,layout=javax.swing.ScrollPaneLayout$UIResource,alignmentX=0.0,alignmentY=0.0,border=,flags=16777536,maximumSize=,minimumSize=,preferredSize=,columnHeader=,horizontalScrollBar=javax.swing.JScrollPane$ScrollBar[,0,0,0x0,hidden,layout=com.incors.plaf.alloy.AlloyScrollBarUI,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.BorderUIResource$EmptyBorderUIResource@78fa5cad,flags=4194664,maximumSize=,minimumSize=,preferredSize=,blockIncrement=10,orientation=HORIZONTAL,unitIncrement=1],horizontalScrollBarPolicy=HORIZONTAL_SCROLLBAR_AS_NEEDED,lowerLeft=,lowerRight=,rowHeader=,upperLeft=,upperRight=,verticalScrollBar=javax.swing.JScrollPane$ScrollBar[,0,0,0x0,hidden,layout=com.incors.plaf.alloy.AlloyScrollBarUI,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.BorderUIResource$EmptyBorderUIResource@78fa5cad,flags=4194664,maximumSize=,minimumSize=,preferredSize=,blockIncrement=10,orientation=VERTICAL,unitIncrement=1],verticalScrollBarPolicy=VERTICAL_SCROLLBAR_AS_NEEDED,viewport=javax.swing.JViewport[,0,0,124x768,layout=javax.swing.ViewportLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=25165824,maximumSize=,minimumSize=,preferredSize=,isViewSizeSet=true,lastPaintPosition=java.awt.Point[x=0,y=0],scrollUnderway=false],viewportBorder=]
6:
com.inductiveautomation.factorypmi.application.components.TemplateRepeater[repeater,0,0,124x768,layout=com.inductiveautomation.ignition.client.util.gui.FillingLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=9,maximumSize=,minimumSize=,preferredSize=]
7:
ToggleStrip
8:
com.inductiveautomation.factorypmi.application.components.template.TemplateHolder[ToggleStrip,0,0,124x768,layout=com.inductiveautomation.factorypmi.application.components.template.TemplateHolder$1,alignmentX=0.0,alignmentY=0.0,border=,flags=16777217,maximumSize=,minimumSize=,preferredSize=]
9:
Root Container
10:
javax.swing.JLayeredPane[null.layeredPane,0,0,124x768,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSize=,preferredSize=,optimizedDrawingPossible=true]
11:
javax.swing.JRootPane[,0,0,124x768,layout=com.incors.plaf.alloy.bk,alignmentX=0.0,alignmentY=0.0,border=,flags=449,maximumSize=,minimumSize=,preferredSize=]
12:
LeftNavigation
13:
com.inductiveautomation.ignition.designer.designable.DesignPanel$DesignableContainerLayer[,0,0,749x783,alignmentX=0.0,alignmentY=0.0,border=,flags=9,maximumSize=,minimumSize=,preferredSize=]
```

---

<div class="post-metadata">

**Author:** ![cmisztur2](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmisztur2/32/4243_2.png) [@cmisztur2](https://forum.inductiveautomation.com/u/cmisztur2)\
**Post date:** [March 25, 2016, 11:02pm UTC](https://forum.inductiveautomation.com/t/passing-value-from-child-template-to-parent-template/11417/3 "2016-03-25T23:02:14Z")

</div>

So my next question is, how do I get the index of a template within a repeater?

---

<div class="post-metadata">

**Author:** ![cmisztur2](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmisztur2/32/4243_2.png) [@cmisztur2](https://forum.inductiveautomation.com/u/cmisztur2)\
**Post date:** [March 25, 2016, 11:19pm UTC](https://forum.inductiveautomation.com/t/passing-value-from-child-template-to-parent-template/11417/4 "2016-03-25T23:19:16Z")

</div>

found it.

[inductiveautomation.com/forum/v … dex#p54279](https://inductiveautomation.com/forum/viewtopic.php?f=70&t=14739&p=54279&hilit=repeater+index#p54279)
