How to clean filter modules?

40 views Asked by At

In my application, users are accessing data that are specific to a station.

Because a user is able to switch from a station to another one, I would like to clean filter modules every time the current station is changed.

Icing on the cake, I would like to warn the user if exist some updates unsaved.

1

There are 1 answers

0
Vincent Vandenschrick On

One idea would be to chain a reset all filter modules action to the one that allows the user to switch its station.

Unfortunately, there is no built-in action that restarts all the application filter modules, but it would not be much complicated to write one. The idea would be to iterate through all the workspace / modules hierarchy and to restart each module.

In order to restart a module, you can have a look to the standard org.jspresso.framework.application.frontend.action.module.ModuleRestartAction (source here). You could even inherit this action and simply override the execute method in order to deal with all the application modules instead of only the selected one.

Of course, if you feel like it could be a good addition to the framework standards, feel free to submit a RFE or even a PR.