Resetting All Components on Change Event

Hi,

I have a input text box (lets call it inputText1), the value of which links to a query and table. Each time the input changes, the query fires and the table contents update - simples enough.

I also have a set of components on the same page, in a container. There are a number of input fields and switches, which I would like to reset to their default state when inputText1 changes (so as not to "remember" the settings between each change).

I know I can achieve this by adding a bunch of "on change" events to inputText1, but that feels overkill.
Instead, is there a quick way to reset a collection of components in one go, in a more dynamic way (i.e. say I add another component, I don't need to remember to add it to a script or change event to reset it).

I guess what I would be looking for is something like a reset event on a container, and when that is triggered it would reset all objects within.

Maybe I've just engineered it sub-optimally and a container isn't the way to go?

Any ideas welcome! Your time is appreciated.

Thanks
Dave

I don't think there is a reset() function for containers but if you really want to be able to be able to use the reset() function, you could format the form component to look like a tabbedContainer and go from there?

otherwise I would recommend programmatically resetting each individually.
you can, though, use a the run script to make it look cleaner
image

2 Likes

Thanks @DavidD

I had a feeling as I was writing this post that a form might be the way to go... I might explore that then unless I get any other good suggestions.
Will wait a while longer to see if anyone comes back with alternative ideas, otherwise I think your solution might be the best :slightly_smiling_face:

1 Like