{/doc/acs-templating {ACS Templating}} {Using the Wizard} Using the Wizard

Overview Of How To Make A Wizard

  1. Create a wizard file (ex. wizard.tcl) that contains the "template::wizard create" code.
    ex.
           template::wizard create -action "wizard" -name my_wizard -params {
              my_param1 my_param2
           } -steps {
              1 -label "Step 1" -url "step1"
              2 -label "Step 2" -url "step2"        
              3 -label "Step 3" -url "step3"
           }
        
    • action - the url where the wizard will always submit, normally its the same as your current wizard file. Has no effect for subwizards.
    • name - use to distinguish between the different wizards, since you can have 1 or more subwizard. name must be no spaces, alpanumeric similar to normal Tcl variable naming convention
    • params - are used to keep values that you would like to pass on to the other steps
    • steps - are use to define what includes to use for each step of the wizard
  2. Add the "template::wizard get_current_step" on wizard.tcl. Make sure that you call any "template::wizard set_param" if needed before calling get_current_step. get_current_step will redirect to the wizard -action properly setting all -params value and its other needed http state vars

    Note: the wizard will rewrite the url always. Only self submitting forms are preserved. Once the form is finished processing the wizard will take over and rewrite the url.

  3. Create the wizard template file (ex. wizard.adp). This file will include the file based current step of the wizard
    ex.
           <include src="\@wizard:current_url\@">
        
  4. Create the individual steps, these are just normal Tcl and/or adp files. So make a step1.tcl, step1.adp, step2.tcl, step2.adp, step3.tcl and step3.adp. Normally these files are self submitting forms
  5. Add "template:wizard forward" on each step (e.g. step1.tcl, step2.tcl, step3.tcl) , usually the code where the step is processed and successful.
  6. On each step add the wizard buttons on the .tcl files. Ex. step1.tcl will include
        template::wizard submit myform -buttons {back next}
        
    On the last step you may want to use the following on step3.tcl
        template::wizard submit myform -buttons {back next}
        
    The following values are acceptable for the buttons: back, next and finish. Back buttons are not rendered if the step is the first step, like wise next buttons are not displayed if its the last step. Finish can appear on any step and will finish the current wizard even if not all steps are done.

Tips And How To Use The Wizard