Skip to content

Reset wizard? #69

Answered by Indemnity83
Indemnity83 asked this question in Q&A
Jan 31, 2023 · 4 comments · 1 reply
Discussion options

You must be logged in to vote

@ju5t that didn't quite work, but got me on the right path to a solution.

For anybody who stumbles on this, the mountMountsWizard function inside the MountsWizard trait is what is responsible for setting up the steps and states. so I can use it to reset the state.

So I added a listener for a reset event that calls the mountMountsWizard() function.

class MyWizardComponent extends WizardComponent
{
    // This is ugly... have to override the $listeners to add our listener
    protected $listeners = [
        'previousStep',
        'nextStep',
        'resetWizard',
        'showStep',
    ];

    public function resetWizard()
    {
        // Get the first step from the collection
        $f…

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ju5t
Comment options

Answer selected by Indemnity83
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants