Closing Containers in templates

So I have a template that displays transmitter data. In that template is a container that holds set points for alarm levels. It’s visibility is controlled by a toggle button. Whenever a page with this template on it is displayed and the set point container is set to visible the set point container remains visible even after leaving the page and coming back. I would like for the container to close every time the window is closed so, upon entering the window again, a user doesn’t have to close all the set point boxes.

  1. I know I could just tell everyone to close the containers (using the CLOSE button) before they leave the window, but not everyone listens very well.

  2. I don’t want to write a script to the visionWindowClosed event if I can avoid it, otherwise I will have to adjust the script every time another instance of the template is used.

Anyone have any pointers? Thanks in advance.

You could write a script for the visionWindowClosed event that finds all of your instances and closes the container in each. So if you add another template instance no change is needed to the script since it automatically finds the instances.

Another way perhaps: Change the cache policy of the window to Never. So each time the window is opened it is opened in the state that it exists in the designer.