Which SDK and Platform version are you using?
SDK: v12.5.0
Platform: v4.2.0
Current Behavior
In a method of a SetParamsButton
I set the new params of a Hiddenfield, the data to store is in dictionary form. When I perform this action the first time everything is fine. But when I perform this action a second time with different parametrization the HiddenField data is expanded rather then replaced.
Expected Behavior
I would expect the data in the HiddenField to be replaced with the value I set.
Context (optional, but preferred)
Can be reproduced using:
from viktor import ViktorController
from viktor.parametrization import Parametrization, TextField, HiddenField, SetParamsButton
from viktor.result import SetParamsResult
from viktor.views import Summary
class MyParametrization(Parametrization):
text = TextField('Text to store as key')
hidden = HiddenField('...')
set_params = SetParamsButton('Set', 'set_params')
class MyController(ViktorController):
label = '...'
summary = Summary()
parametrization = MyParametrization
def set_params(self, params, **kwargs):
return SetParamsResult({
'hidden': {
params.text: 1
}
})