Forum OpenACS Q&A: Anyone made an ad_form namespace diagram?

As I learn to use ad_form I am mentally constructing a diagram of the different namespaces and the ways of passing values between them.  It is rather incomplete but led me to wonder whether someone else might have already done a better one and not published it yet.

It is intended to help with issues like this: I have a table of contact points including home and work phone numbers and email addresses, etc. Each is a row like:
code='HomePhone' c_val='416-555-1212' name='Home Phone'
I wanted to use ad_form -extend to create widgets with name=code, val=c_val only for the contact points that actually exist for a person. Using the variables in the code block of a db_multirow,

I cannot do this:
      ad_form -name foo-edit -extend -form {
        {$code:text {label "$name"}  {mode display} {display_value "$c_val"} }
because the $code value is not available to template::element::create, but $name and $c_val have already been evaluated.

but this direct call succeeds for all parts of the element:
template::element::create foo-edit $code -datatype text -label "$name" -mode display -display_value "$c_val"

I would like to understand better why this is so and to be able to change technique when needed without so much trial and error.  A diagram might help.

Collapse
Posted by Mark Aufflick on
I don't think this is quite what you're after, but have you seen Roberto's pdf cheat sheet on ad_form, it's handy for visualising the ad_form blocks. It's luckily archived by the wayback machine:

http://web.archive.org/web/20040204035714/http://www.brasileiro.net/writings/openacs/ad-form-quick-ref.pdf