How to Keep Configurator Inputs When Refreshed (InputMatrix)
There are times when you want the last input entered by a user in a configurator to persist after a refresh, and this may include keeping input that would not normally be visible after that refresh. For example, a configurator with this behavior:
An InputMatrix to select various rows as input.
Other inputs to filter that InputMatrix, so that the user can easily find specific rows to select.
The problem you will have with this design is that you lose your selections after changing the filters. Luckily, there is a way to get your selections back after that refresh: When you create a parameter, you can access their previous value using getValue(), as long as you have not overwritten it yet (usually by using setValue()).
For Input Matrix in particular, each row will have a ‘selected’ key, with value of true or false. You can manually set them so that rows are pre-selected when the InputMatrix is presented. Combining this with the ability to get previous input with getValue() allows you to keep selections that would otherwise be lost or hidden.
Keep in mind that there are more elegant ways to do this, but I threw together this small example:
Final note: this idea can be extended for the other InputTypes as well, although some you will use entry.value instead of entry.getValue().
Found an issue in documentation? Write to us.
Â