Wizard "nextAction" save
Hello everyone. Is there a way to save the state of the current step when press "next" button from wizard?
34 Replies
Probably using ->afterValidation() method
is not working. Any idea?
what code are you trying?
In my custom Livewire component, which incorporates a wizard form, it seems the ->afterValidation method is not available for the wizard
step, actually
I've also tried this but I don't know how can I access the state of the form?
?
Should I add some validation rules in my custom component?
not required
I have like this but when I press next it goes to the next step instead of show the dump
hum, it is a custom livewire component, right? What about your mount method?
Yes, it's a custom livewire component and this is the mount method
did you add the form statePath?
no, should I do this? if yes, how can I do it? I'm not sure if I know what is the form statePath
->statePath('data') oh, this one is . I didn't add it. I have only the model
statePath will store the form data in the
$data
. However, you can declare all fields in the class public $energy_payment_method = '';
I've declared the data in class public
Did you do this?
?
yes, I also have this now
ok, Is the dump displayed when you press the next button?
nope
console errors?
only this one but I think is not related with my stepper
are you using the panel builder or only the form builder?
I am using the form builder only
this was supposed to work..
yeah, I know... but what do you think about this ? Can implement the saving here, maybe ?
https://github.com/leandrocfe/wizard-example
It is working here
GitHub
GitHub - leandrocfe/wizard-example
Contribute to leandrocfe/wizard-example development by creating an account on GitHub.
this model is working. the only problem for me is the first step which represents a repeater relationship
Thank you so much! Actually the problem was 'skippable'
You didn't mention it, even when you shared some code that you were trying 🤷♂️
Yeah, I have a huge wizard code and I forgot I have "skippable" , but thank you so much again
For anyone needing to save the wizard/form while using skippable option
listen to
next-wizard-step
event in the create and Edit Page, for example: