Skip to main content

Output field

note

For larger sections of text in the parametrization, see Text

An OutputField can be used to display a textual or numeric value to the user within a parametrization that cannot be modified by the user. The value must be set in the parametrization and can be a static value (str, float), or obtained dynamically using a Lookup or a callback function, similar to setting the visibility when hiding a field.

def sum_x_y(params, **kwargs):
return params.param_x + params.param_y


class Parametrization(ViktorParametrization):
param_x = NumberField('X')
param_y = NumberField('y')
not_in_params = OutputField('X + Y', value=sum_x_y)
note

The value of the OutputField field is not included in the params.