Back button in a SessionWizardView

75 views
Skip to first unread message

César García Tapia

unread,
Feb 1, 2014, 5:04:03 PM2/1/14
to django...@googlegroups.com
I'm writing a quite complex Wizard (lots of pages, lots of inputs), so I'd like to add a Back button to it.

My first thought was just using a "history.back()" javascript call, but in the previous form I had some inputs created with Javascript that get lost if I just browse back, so I need to access the data stored in the Wizard.

I don't really care about keeping the data in the current step (although it would be nice), but I need to access *all* the data of the previous step, as it will be sent to the done() method of the wizard.

Any suggestions, please?

Asad Jibran Ahmed

unread,
Feb 2, 2014, 9:30:28 AM2/2/14
to django...@googlegroups.com
We had a similar requirement in one of our products. We solved it by assigning the user a unique transaction id when they start the process, and saving all data in a temp db (redis) until the user completed the process. And whenever the user accessed a page with the transaction id in the get params, the data was autofilled in the form.

Maybe you can do something similar by saving data for each part of the wizard in a temp db under one key and using that to pre-populate the forms?

Also, we used keys that woyld expire after some time, thus if the user didn't complete the process, our db would start filling up with stale transaction data.

Hope that helps.

César García Tapia

unread,
Feb 2, 2014, 3:20:58 PM2/2/14
to django...@googlegroups.com
Hi, Ahmed.

Your suggestion makes sense, but I think that, being called *Session*WizardView, it's very likely that this information is already stored in the session data.

The question is how could I "redraw" a concrete step, filled with the data previously entered by the user. I'm sure it's possible, but I can't figure out how.
Reply all
Reply to author
Forward
0 new messages