# Custom method on container does not set custom component property

**URL:** <https://forum.inductiveautomation.com/t/custom-method-on-container-does-not-set-custom-component-property/115915>\
**Category:** Ignition\
**Tags:** vision, scripting\
**Created:** [June 9, 2026, 8:47pm UTC](https://forum.inductiveautomation.com/t/custom-method-on-container-does-not-set-custom-component-property/115915 "2026-06-09T20:47:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [June 9, 2026, 8:47pm UTC](https://forum.inductiveautomation.com/t/custom-method-on-container-does-not-set-custom-component-property/115915/1 "2026-06-09T20:47:07Z")

</div>

I would like to set several custom properties when a Window opens or is navigated back to.  
Currently I have a script on the Window's `internalFrameActivated` that makes a call to a custom function on a Container.

```python
def setValues(self):
	def handleContainer(container):
		for comp in container.getComponents():
			if comp. __class__. __name__ == 'PMILabel':
				processLabels(comp)
			
	def processLabels(label):
		try:
			setattr(label, 'myVal', 'Bonjour')
			print 'processLabels call'
		except AttributeError:
			print lalel.setPropertyValue('myVal', 'Bonjour')
		
		
	handleContainer(self)

```

I have four labels, each with a custom property of `myVal`. The custom function executes, and prints `processLabels`, but the label's texts remain unchanged.

The previous script used this instead of `setattr`: `label.myVal = 'Bojnour'`

What am I missing?

---

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [June 9, 2026, 8:52pm UTC](https://forum.inductiveautomation.com/t/custom-method-on-container-does-not-set-custom-component-property/115915/2 "2026-06-09T20:52:52Z")

</div>

Turns out, it helps to bind the text property to the correct custom property!  
🤦‍♂️

EDIT: Ok, that worked on the test dummy, but it's not working at all in the actual project.

Same basic setup, except that I get an error stating that the custom function does not exist, specifically `object has no attribute setRepeaterMinEnable`

This is the call from `internalFrameActivated`:

```python
system.gui.getParentWindow(event).getComponentForPath('Root Container.Container Recipe Load').setRepeaterMinEnable()

```

This is the function to be called:

```python
def setRepeaterMinEnable(self):

	def processContainer(container):
		for comp in container.getComponents():

# --- If it's a Template Repeater ---
			if comp. __class__. __name__ == "TemplateRepeater":
				processTemplateRepeater(comp)
			elif hasattr(comp, 'getComponents'):
				processTemplateRepeater(comp)
				
				
	def processTemplateRepeater(repeater):
		templates = repeater.getLoadedTemplates()
		try:
			repeater.minEnable = 0
			print 'minEnable write success?'
		except:
			print 'minEnable write error'
		
processContainer(self)

```

And anther error stating that `NameError: name 'processContainer' is not defined`.

EDIT 2:  
Indent problem! 🤦‍♂️

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 10, 2026, 12:25am UTC](https://forum.inductiveautomation.com/t/custom-method-on-container-does-not-set-custom-component-property/115915/3 "2026-06-10T00:25:57Z")

</div>

Long-standing gap in the application of Ignition's `PyComponentWrapper` everywhere it might be needed. When jython applies default wrapping to a `VisionComponent`, it doesn't end up with the attributes for custom properties and custom methods. Details here:

> [@Transaction groups triggered expression item updating when trigger is false](https://forum.inductiveautomation.com/t/transaction-groups-triggered-expression-item-updating-when-trigger-is-false/17196/14):
>
> Ok, so I’ve been down the rabbit hole and found Ignition’s (undocumented) PyComponentWrapper. I haven’t deciphered it enough to be sure, but it seems to be invoked only for particular situations, based on the string constants in the class file (like “getComponent” and “getComponents”). To play with this, I constructed a conversion adapter like so: public class PyComponentAdapter implements PyObjectAdapter { public PyComponentAdapter() {} @Override public boolean canAdapt(Object jObj) { …

TL/DR: Install my Integration Toolkit to get fully automatic wrapping. If you cannot do that, use the `PyComponentWrapper` manually.
