I’ve been playing around with the Wizard component to make a wizard that allows multiple objects to be created at once. For example, I have a “scenario” class, which is a foundation for other items to be created within, and a number of other classes, such as “events” that are created within a given scenario. I want my wizard to help the user create a scenario, and then an event within that scenario.
My application uses stickyGet to tell each page what the currently active scenario is, and that’s where the problem arises. My wizard gets created with all the steps to create a scenario, and then an event within that scenario. However, once I finish the step where the scenario is created I’m having difficulty finding a good way to set the stickyGet for the rest of the wizard to use.
If there’s no form needed on the final step of the scenario creation, I can use something like
$w->buttonNext->link([$w->urlNext(), ‘scenario_id’ => $scenario[‘id’]]);
return (new \atk4\ui\jsExpression(‘window.location.href = ’, [$w->urlNext(), ‘scenario_id’ => $f->model[‘id’]]));
That does work, but it just seems awkward to me – like there should be a better way. Is there? Or should I just learn to love the above?
Thanks in advance for your help.