# Dynamic components using Python

**URL:** <https://forum.inductiveautomation.com/t/dynamic-components-using-python/4562>\
**Category:** Ignition\
**Created:** [June 1, 2012, 10:38am UTC](https://forum.inductiveautomation.com/t/dynamic-components-using-python/4562 "2012-06-01T10:38:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Koot](https://avatars.discourse-cdn.com/v4/letter/k/f05b48/32.png) [@Koot](https://forum.inductiveautomation.com/u/Koot)\
**Post date:** [June 1, 2012, 10:38am UTC](https://forum.inductiveautomation.com/t/dynamic-components-using-python/4562/1 "2012-06-01T10:38:32Z")

</div>

Hi

I have created a template (which has one or two properties in its root that enables the template to report on a specific part of my system). What I need to do is:

a) Dynamically create a variable amount of instances of this template in a container  
b) These instances must be able to dynamically position themselves depending on the size of the container (similar to the FlowLayout Manager in Java)

I imagine I will need “the invert” of the function system.gui.getParentWindow(event).getComponent() (thus, something like system.gui.getParentWindow(event).createComponent() perhaps?). I will of course also need to pass some parameters into it in order to initialise the properties in its root.

Thanks

---

<div class="post-metadata">

**Author:** ![James.Lorenz](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/james.lorenz/32/3290_2.png) [@James.Lorenz](https://forum.inductiveautomation.com/u/James.Lorenz)\
**Post date:** [June 4, 2012, 11:32pm UTC](https://forum.inductiveautomation.com/t/dynamic-components-using-python/4562/2 "2012-06-04T23:32:58Z")

</div>

Ignition does not allow for dynamic creation of components for security and complexity reasons. Your best bet is to pre-determine template locations in a window by placing the templates in the window like you usually would, and then dynamically change the “visible” property of templates via scripting.
