# Elegant Way to Disable All Components in a Window?

**URL:** <https://forum.inductiveautomation.com/t/elegant-way-to-disable-all-components-in-a-window/21451>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [December 17, 2018, 3:31pm UTC](https://forum.inductiveautomation.com/t/elegant-way-to-disable-all-components-in-a-window/21451 "2018-12-17T15:31:36Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Stevenson.Yuan](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@Stevenson.Yuan](https://forum.inductiveautomation.com/u/Stevenson.Yuan)\
**Post date:** [December 17, 2018, 3:44pm UTC](https://forum.inductiveautomation.com/t/elegant-way-to-disable-all-components-in-a-window/21451/4 "2018-12-17T15:44:29Z")

</div>

You can use the getComponents method, BUT the caveat is the limitation. You either get all components in the root container which is equivalent to 1 level, but if you have nested components/templates it gets trickier.

```auto
rc = system.gui.getParentWindow(event).getRootContainer()
	for component in rc.getComponents():
		component.enabled=False

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/elegant-way-to-disable-all-components-in-a-window/21451)._
