Can't control invisible features on a container

I can't seem to control visible / invisible features on a container.
I am using the code "container1.hidden = true" in the opening of the app and it has no effect.

I am attaching some screen shots.


1 Like

Hello @mdsmith1,

container1.hidden = true won't work because component properties are read-only at runtime in Retool.

Instead, create a Temporary State (for example, showContainer) and bind the container's Hidden property to that state:

{{ !showContainer.value }}

You can then control the container's visibility by updating the state:

showContainer.setValue(true);  // Show container
showContainer.setValue(false); // Hide container

Using a temporary state to drive the hidden property is the recommended approach for dynamically showing or hiding components in Retool.

The forum link is attached below. Also, the solution you provided in your 2023 forum post is working correctly for this use case.

WildeStudio:

Yes, your code showContainer.setValue(true); // Show container works perfectly.

Thank you so much.

I will mark your answer as the solution.

Mike