Reset Variables in Embedded module in Workshop

Hi,

I have Module A which has an embedded module B. The module B end state should be to apply an action.

I open module B from within module A and I click on some radio buttons or set some values via numeric input and ideally the user clicks on a button to then kick off an action.
But sometime, the user will decide not to click the button and just click on the backdrop to close the overlay.
However, the values in the embedded module are not reset and when the module B will be open again by the user, the values entered previously will remain which may be good sometime (when reopening the module B for the same purpose) but may not be in other cases (when opening it for another context).

I tried adding the variables as input to the interface and setting up a reset on close of those variables, but it does not yield the expected result.

Unfortunately the capability you are referring to is not currently supported. The product team is aware of the feature request but there are currently no plans to support this in the immediate future.

Thanks for the answer.
Is there no workaround to actually reset the state of the embedded module?

That makes embedded module unusable in some cases.
Could we have a way to reset or trigger a reload of the module when we close an overlay for example?

I found a way to actually not allow to close the overlay on a backdrop for this embedded module and added a button to allow to close the overlay.
With this button, I can use events to reset the variables in the embedded module.

It would be great to add those events directly from the “on-close” even of an overlay

Could you share how you did this? Thanks!

One way you can get an embedded module to reset its variable state every time it is opened (particularly in something like an overlay that fully unmounts in between being shown), you can instead use an iframe widget pointed to the URL for the embedded module, possibly using URL routing variables and the ?embedded=true query param to hide the sidebar.

@rjccf - you should be able to turn off the “Close overlay on backdrop click” option if you want to disallow closing by clicking on the backdrop. Then you can configure “Reset variable” or “Recalculate” events for each variable you want to reset in the overlay “On close” config. As long as the overlay is defined in the embedded module you should have access to reset embedded module variables from the overlay.


Outside of this we hope to create a more first class solution for resetting embedded module variable state when some specified mapped variable(s) change.

1 Like