Elegant Way to Disable All Components in a Window?

I have a parameterized popup window. We have a little gif that runs while it’s loading, however some components load fast than others and are able to be selected while the rest is being loaded. Then once everything is loaded, anything that was selected is reset.

I know how the trigger I am going to use to disable/enable our components (did the loading go from invisible to visible or vice verse), but is there an easy way to just disable every line entry/combo box with a line? Or do I have to do each component on its own line? I’d like to keep the code as simple, readable and maintainable as possible.

Instead of disabling each component, why not just put a semi-transparent box over the page (make sure the gif is on top of it) and add an empty mouseClick script, so when the box is clicked on, it goes into the empty script instead of clicking on a property. I have done this in the past and it worked reasonably well.


That’s a pretty good solution, I like it.

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.

rc = system.gui.getParentWindow(event).getRootContainer()
	for component in rc.getComponents():
1 Like

Nice, for once I am lucky this has no nesting or hierarchical order. The only issue is that the loading gif itself is a component. But I suppose I can just do a if statement to check for that in the for loop.