Forum OpenACS Development: ad_form confirm_template

Collapse
Posted by Michael Aram on
Hello!

I'm just trying to use the built in "confirmation page functionality" of ad_form and am wondering, that only those variables seem to be passed to the confirmation template, that were are defined within the "extend block" of the form that contains the switch -confirm_template.

Example one:
----------------
ad_form -name compose \
-confirm_template confirm \
-form {
{sender:text(inform)
{label "1"}
{value "2"}
}
}
ad_form -extend -name compose -form {
{subject:text
{label "3"}
{html {size 60}}
}
}
----------------
only the variable @sender@ is available within the confirmation template - the @subject@ is not....

Example two:
----------------
ad_form -name compose \
-form {
{sender:text(inform)
{label "1"}
{value "2"}
}
}
ad_form -extend -name compose \
-confirm_template confirm \
-form {
{subject:text
{label "3"}
{html {size 60}}
}
}
----------------
@subject@ exists, but not @sender@

Example three:
----------------
ad_form -name compose \
-confirm_template confirm \
-form {
{sender:text(inform)
{label "1"}
{value "2"}
}
}
ad_form -extend -name compose \
-confirm_template confirm \
-form {
{subject:text
{label "3"}
{html {size 60}}
}
}
----------------
same as example 1

Is this a bug or am I doing something the wrong way?

Collapse
Posted by Tom Jackson on
I don't know anything about ad_form, but the evidence you present could be caused by an initialization of the confirm_template each time it is used as a flag, something like:

set confirm_vars [list]

Although your last example seems to confound the situation. Maybe it only initializes once? Or does ad_form logic differ with which template it is trying to build up, maybe skipping certain blocks?

Procedures and pages which do multiple things are deadly.