Index: openacs-4/packages/acs-templating/www/doc/guide/wizard-procs-doc.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/guide/wizard-procs-doc.adp,v diff -u -r1.2.2.1 -r1.2.2.2 --- openacs-4/packages/acs-templating/www/doc/guide/wizard-procs-doc.adp 25 Aug 2015 18:02:16 -0000 1.2.2.1 +++ openacs-4/packages/acs-templating/www/doc/guide/wizard-procs-doc.adp 5 Jul 2016 12:14:22 -0000 1.2.2.2 @@ -26,11 +26,11 @@ the wizard
  • -

    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 +

    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.

  • Create the wizard template file (ex. wizard.adp). This file @@ -43,9 +43,9 @@
  • 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 this files are self submitting -forms
  • Add "template:wizard forward" on each step (eg. step1.tcl, -step2.tcl, step3.tcl) , usually the code where the step is -processed and successful.
  • On each step add the wizard buttons on the .tcl files. Ex. +forms
  • Add "template:wizard forward" on each step (eg. +step1.tcl, step2.tcl, step3.tcl) , usually the code where the step +is processed and successful.
  • On each step add the wizard buttons on the .tcl files. Ex. step1.tcl will include
         template::wizard submit myform -buttons {back next}
    @@ -80,14 +80,14 @@
         
     
  • -

    How do you set the value of a wizard param?

    Use "template::wizard set_param myparam_name" to set it. -Normally you place this in the steps of the wizard where the form -has been processed. A param is normally used when you want to reuse -a value across the steps.

    Note: if you are to use "template::wizard set_param" on a wizard -file ex. (wizard.tcl). Make sure to do it before "template::wizard -get_current_step". So when "template::wizard get_current_step" -redirects it will properly set the correct values of the param to -the new value.

    +

    How do you set the value of a wizard param?

    Use "template::wizard set_param myparam_name" to set +it. Normally you place this in the steps of the wizard where the +form has been processed. A param is normally used when you want to +reuse a value across the steps.

    Note: if you are to use "template::wizard set_param" +on a wizard file ex. (wizard.tcl). Make sure to do it before +"template::wizard get_current_step". So when +"template::wizard get_current_step" redirects it will +properly set the correct values of the param to the new value.

  • How do you get the value of a wizard param?

    For example you wizard was created this way: @@ -120,14 +120,15 @@ set my_param2 [template::wizard get_param my_param2] -Note: "template::wizard get_param" has the advantage of getting the -param value during the response time. What does this mean? It will -properly get the current value of the param which was set by -"template::wizard set_param", while ad_page_contract will not pick -that up since it will get what is the request http var value. This -is because "template::wizard get_param" gets the value from the tcl -var while ad_page_contract gets the value from the http var. So -while processing in tcl that value may change.
  • +Note: "template::wizard get_param" has the advantage of +getting the param value during the response time. What does this +mean? It will properly get the current value of the param which was +set by "template::wizard set_param", while +ad_page_contract will not pick that up since it will get what is +the request http var value. This is because "template::wizard +get_param" gets the value from the tcl var while +ad_page_contract gets the value from the http var. So while +processing in tcl that value may change.
  • How can you get the url of a wizard that is not your current step?

    You can use the following on your wizard.adp @@ -164,12 +165,14 @@ as a subwizard.

    Note: That visited steps will loose its value when moving from one subwizard to another subwizard in the same level. In order to preserve this you must call "template::wizard -load_last_visited_step -key $yourkey" before "template::wizard -get_current_step", after "get_current_step" call "template::wizard +load_last_visited_step -key $yourkey" before +"template::wizard get_current_step", after +"get_current_step" call "template::wizard save_last_visited_step -key $yourkey"

    Also the wizard params name is present across the curent wizards being used, so the developer has to be aware not to use the same names with different purpose. For example on main wizard with have -a param called "name" for the user name. And on on sub wizard we -have the param again called "name" but used for the file name.

    +a param called "name" for the user name. And on on sub +wizard we have the param again called "name" but used for +the file name.