You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This got exposed when testing #224 - when function producing options for select/checkbox/radiobuttons group returns different values depending on state of some other widget, the value of the variable representing the select widget may become stale.
E.g.
Assuming that there are two widgets:
optionsType radiobutton - with two available options: 'colors' and 'vegetables'
typedOptional checkbox group - which is populated by a function that depending on optionsType selection returns:
** red, green, blue if optionsType has value 'colors'
** plums, tomatoes, potatoes if optionsType has value 'vegetables'
Lets assume that user has selected 'colors' optionType and they have 'red' and 'blue' options ticked off.
When they change the option type to 'vegetables' the UI will get updated, and none of the available vegetables will be checked out, but the variable typedOptional will still have the 'blue' and 'green' value.
This means that all other widgets that depend on typedOptional will use stale value of that variable.
The suggested solution for this is to make sure that for (multi)select/checkbox and radiobutton group which get available options from R function the value gets refreshed/reset when control is identified as affected by change in the UI (through dependency graph).
The business rules for the refresh could be:
if current value is null do nothing
new value <- intersection of current value and available values
Note!
Currently the multi-select widget does not expose this issue only because it (incorrectly) triggers window.RCAP.controlUpdate when its state is synced from R - resulting in loopback (this also exposes as double-refresh of dashboard).
The text was updated successfully, but these errors were encountered:
This got exposed when testing #224 - when function producing options for select/checkbox/radiobuttons group returns different values depending on state of some other widget, the value of the variable representing the select widget may become stale.
E.g.
Assuming that there are two widgets:
** red, green, blue if optionsType has value 'colors'
** plums, tomatoes, potatoes if optionsType has value 'vegetables'
Lets assume that user has selected 'colors' optionType and they have 'red' and 'blue' options ticked off.
When they change the option type to 'vegetables' the UI will get updated, and none of the available vegetables will be checked out, but the variable typedOptional will still have the 'blue' and 'green' value.
This means that all other widgets that depend on typedOptional will use stale value of that variable.
The suggested solution for this is to make sure that for (multi)select/checkbox and radiobutton group which get available options from R function the value gets refreshed/reset when control is identified as affected by change in the UI (through dependency graph).
The business rules for the refresh could be:
Note!
Currently the multi-select widget does not expose this issue only because it (incorrectly) triggers window.RCAP.controlUpdate when its state is synced from R - resulting in loopback (this also exposes as double-refresh of dashboard).
The text was updated successfully, but these errors were encountered: