Skip to main content

Creating steps

New in v12.9.0

Similar to a Page, grouping can be achieved by using the Step class. Other than with pages, with steps the developer can dictate the order of pages to be visited: the user is not able to move freely between pages but moves to the next/previous step with a next/previous button. Page and Step cannot be combined within a single parametrization.

A Step is defined in the parametrization similar to a Page. The labels of the next and previous buttons can be set per step:

from viktor.parametrization import ViktorParametrization, Step, TextField, NumberFieldclass Parametrization(ViktorParametrization):    step_1 = Step('Step 1 - without views', next_label="Go to step 2")    step_1.input_1 = TextField('This is a text field')    step_1.input_2 = NumberField('This is a number field')    step_2 = Step('Step 2 - with views', views=['geometry_view', 'data_view'], previous_label="Go to step 1")    step_2.input_1 = TextField('This is a text field')    step_2.input_2 = NumberField('This is a number field')