Passing stickyGet values from within a wizard form onSubmit callback

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’]]);

just fine. However, if I do have a form on that final step, I need a javascript equivalent of it that I can return from my onSubmit function. I’ve been able to do something like:

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.