Forum OpenACS Development: wizard back button problem.

Collapse
Posted by Jun Yamog on
Hi,

I would like to ask help on this.  The current problem right now is that we validate the form even if we hit the back button on the wizard.  I think lars removed the forward for also a valid reason of the values not being submitted.

Here is the code on the issue

    if { [ns_queryexists wizard_submit_back] && [string equal $wizard_name [ns_queryget wizard_name]]} {

    set last_index [expr [lsearch -exact $steps $current_id] - 1]
    set last_id [lindex $steps $last_index]

        # LARS: I removed this, because it causes forms to not save their changes when you hit the back button
        # If you construct your form, so it calls 'wizard forward' in the -after_submit block, things will
        # work the way you expect them to
    # template::forward [get_forward_url $last_id]
    }

We basically want to address lars concern here and also having the back button not run through the form validation.  Can someone show me the which direction to take to fix both issues?  Thanks.

Collapse
Posted by Mark Aufflick on
I would have thought the whole point of a back buton in a wizard was to roll BACK the changes enacted by that form - or at least to not enact any changes to the form.

Perhaps to make it clear, the back button handler could test to see if they made any changes, and display a warning in the resultant page alerting them that their changes were lost.