Is it possible to add a button on a FormWizard form which can direct the user to a specific step in the wizard?
I can obviously get them to go back or start again but I'd like to be able to offer the chance to go to a specific step and change their entries.
The Form Wizard gives you more control over your results than one-click forms do. The wizard lets you make decisions about certain aspects of a form's design and produces a form based on your instructions.
There are five object wizards in Access — for tables, queries, forms, reports, and pages. In addition, there is a wizard for creating whole databases. All the wizards, especially the Database Template Wizard, are useful for the Access student because you can get to see how Microsoft did it.
Yes, it's possible. Simplest way is to use NamedUrlWizardView
If you use simple WizardView, you have to send wizard_goto_step
parameter with a value equal to step name.
Let's say you have WizardView
with steps like next
class OrderWizardView(SessionWizardView):
form_list = (
('select_customer', forms.WizardCustomerForm),
('products', forms.WizardProductFormset),
('order', forms.WizardOrderForm),
('customer', forms.WizardCustomerDetailsForm),
('review', forms.WizardReviewForm),
)
For Previous/First step you can use {{ wizard.steps.prev }}
and {{ wizard.steps.first }}
template variables.
<button name="wizard_goto_step" value="{{ wizard.steps.first }}">First Step</button>
<button name="wizard_goto_step" value="{{ wizard.steps.prev }}">Prev Step</button>
If you need a specific step - use its name!
<button name="wizard_goto_step" value="select_customer">Select customer</button>
<button name="wizard_goto_step" value="products">Add products</button>
...
<button name="wizard_goto_step" value="review">Review</button>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With